Home | | Network Programming and Management | Introduction to socket programming

Chapter: Network Programming and Management - Elementary TCP Sockets

| Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail |

Introduction to socket programming

Most network application can be divided into two programs: client and server with the communication link between them as shown:

Introduction:

 

Most network application can be divided into two programs: client and server with the communication link between them as shown:


Examples are : A web browser communicating with a web server. A FTP client fetching a file form an FTP server etc. A client normally communicates with a server at a time. However, a server is likely to communicate with multiple client. The client and server communication with in the same Ethernet and the communication when LAN connected through WAN is shown below.



As seen in above figure , TCP and IP protocols are normally part of the protocol stack within the kernal. In addition to TCP and IP, other protocol like UDP is also used. IP that was in use since early 1980 is called as IP version 4 (Ipv4). A new version IP version 6 (Ipv6) is being used since mid 1990.

 

 

OSI model for the Internet protocol suite: The following figure provides the comparison of OSI reference model with that of Internet protocol suite.


The upper three layers of OSI model are combined into a single layer called the application. This is the Web Client (Browser), Telnet client, the Web Server, FTP server or whatever application we are using. The transport layer that are chosen are TCP and UDP. As shown in the figure, it is possible to bypass both TCP and UDP and the application layer may directly use Ipv4 or Ipv6. This is called raw socket.

 

The two program interface the we will be studying are sockets and XTI(X/Open Transport Interface) . It is intended to study : how to write applications using either Sockets or XTI that use either TCP or UDP. We need this because, upper three layers handle all the details of the application (FTP, Telnet or HTTP etc) and know little about the communication details. Whereas the lower four layers know little about the application but handle all communication details: sending data, waiting for an acknowledgement sequencing data that arrives out of order , calculating and verifying the checksums and so on. Upper three layers are normally provided as part of the operating system kernal.

 

 

The Transport Layer:

 

The transport layer makes use of TCP and UDP protocols. UDP is a simple, unreliable, datagram protocol while TCP is a sophisticated, reliable, byte stream protocol. We need to understand the services provided by these two transport layer to the application, so that we know what is handled by the protocol and what we must handle in the application.

 

Although, it is known as TCP / IP suite, there are more members to the family as shown below.


Both Ipv4, Ipv6 are shown in the above figure. Moving from right to left in this figure, the rightmost four application are using Ipv6. We need to understand AF_INET 6 and sockaddr_in6 in this. The next five applications use Ipv4. The tcpdump communicates directly with the data link using either BPF (BSD Packet Filter ) or DLPI (Data Link Provider Interface). The dashed line marked as API is normally either sockets or XTI The interface to BPF or DLPI does not use sockets or XTI. traceroute uses two sockets : one for IP and other for ICMP. Each of the protocol is described below.

IPv4: It provides the packet delivery service for TCP, UDP, ICMP and IGMP. It uses 32 bit address.

 

IPv6: It Is designed as replacement for IPv4. IT has larger address made up of 128 bits. It provides packet delivery service for TCP, UDP and ICMPv6.

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail


Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.