0% found this document useful (0 votes)
58 views

TCP Udp

TCP UDP in detail
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
58 views

TCP Udp

TCP UDP in detail
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 15
4.1 Introduction : , The transport layer is on top of the Internet layer and it looks after mainly the transport of packets from the source to final destination. This is known as end to end delivery. . In TCP/IP suite the transport layer has two important protocols + TCP and UDP. . The UDP is simpler and useful when speed of delivery is more important than the loss of few datagrams. . But TCP is more useful when errorfree transmission of datagrams ig more important than the speed of delivery. . ‘Therefore UDP is used for the applications such as transmission of digitized images, voice and video. . ‘Whereas TCP is used for business or scientific data. A.2__ User Datagram Protocol (UDP) : Ubi ‘ 08, 10 Marks, Dec. 13, 3 =e] The User Datagram Protocol is a very simple protocol. It adds little to the basic functionality of IP. Like IP, it is an unreliable, connectionless protocol. ‘You do not need to establish a connection with a host before exchanging data with it using UDP, and there isno mechanism for ensuring that data sent is received. A unit of data sent using UDP is called a Datagram. UDP adds four 16- bit header fields (8 bytes) to whatever data is sent. ‘These fields are : a length field, a checksum field, and source and destination port numbers. “Port number”, in this context, represents a software port, not a hardware port. The concept of port numbers is common to both UDP and TCP. The port numbers identify which protocol module sent (or is to receive) the data. Most protocols have standard ports that are generally used for this. For example, the Telnet protocol generally uses port 23. The Simple Mail Transfer, Protocol (SMTP) uses port 25. The use of standard port numbers makes it possible for clients to communicate with a server without first having to establish which port to use. The port number and the protocol field in the IP header duplicate each other to some. extent, though the protocol field is not available to the higher-level protocols. IP uses the protocol field to determine whether data should be passed to the UDP or TCP module. Scanned with CamScan Cetiiienee tenet = ear SS the port mumber to determine which application-layer protocol sh S 1OUId toon: Mtg . ‘UDP or TCP us the data. ‘Although UDP isn’t reliable, it is still an appropriate choice for many applications, 4 j, . Ih is real-time applications like Net audio than send it again out of sequence. It is als Management Protocol (SNMP). A214 Well Known Ports for UDP : ‘ome well known port numbers used by ‘and video where, if data is lost, i's better 10d yy thet it Nk iso used by protocols like the Simple Nema Table A.2.1 shows s ae tees used by UDP and TCP. | orts used with UDP Table A.2.1: Well known pi Port | Protocol Description 7_| Echo ‘The received datagram is echoed back to sender. 9 _| Discard ‘Any received datagram is discarded. | L1_| Users ‘Active users. j 13_ | Daytime Return the day and the current time. j 17 | Quote Return the quote of the day. 19 | Chargen__| To return string of characters. 53 | Nameserver | Domain Name Service (DNS). 67. | BOOTP, | Thisis the server port to download the bootstrap information, 68 | BOOTP, This is the client port to download bootstrap information. 69 | TFIP Trivial File Transport Protocol. 111_| RPC# Remote Procedure Call. | 123 | NTP ‘Network Time Protocol. | 161 | SNMP ‘Simple Network Management Protocol. 162 | SNMP ‘Simple Network Management Protocol (Trap). A.2.2 User Datagram : User Datagram Protocol (UDP) provides'a connectionless packet service that offers unreliable ‘pest effort’ delivery. This means that the arrival of packets is not guaranteed, nor is the comet sequencing of delivered packets. Applications that do not require an acknowledgement of rece’ video broadcasting uses UDP.» + UDP is also used by applications that typically transmit small amounts of data at one time, for example, the Simple Network Management Protocol (SNMP). | UDP provides @ mechanism that application programs use to send data to ther aplisitt | programs. UDP provides protocol port numbers: used to distinguish between. multiple progres executing on a single device. That is, in addition tothe data sent, each UDP message contains both a destination port umber and a source port number. This makes it possible for the UDP software at the destination 2 cae the message to the correct application program, and for the application program ' send a reply. UDP packets are called as user datagrams. They have a fixed formal ¢ : : -bytes. The f of user datagram is as shown in Fig. A.2.1. ae pt of data, for example, audio ot ocanned Wit Gal Source po Dumber 18 bits Total tength 16 bits Destination pos ber 18 bite Mt G-orpFig, r UDP header is divided i 8 AQL: User datag ‘The into the following four ‘gram format gourte port: : ; 16-bit fictds - Gqurce Port is an optional field, when my umed to leanii | be asst to be the port to which a et i indicates the port ofthe sending process, may and mn. If not used, a value of zero is inserted. owl be lesen he Reef ; : the absence of any pestination port: an Destination Port has a meaning within the context of. i : @ particular Internet destination address. Length = this is the size in bytes of the UDP packet, including the hea xb, te length of the header alone. 1 the header and data. The minimum length uoP Checksum = ‘his is used to verify the integrity of the UDP header, The checksum is perfomed ona pseudo pader” consisting of information obtained from the IP header (Gorirce and destination address) as well ssthe UDP header. 423 UDP Pseudo Header : + The purpose of using a pseudo-header is to verify that the UDP packet thas reached its correct ination, i i rt number within . = ee destination consists of a specific machine anda specific protocol po i verify the destination, that machine. t ; sper, Thus, t0 ver ify the i port mt soon Te adaressas el itself specifies only the prove vers the destination. Dole aie computes a checksum that cov ers: on the as the UDP packet. safle * At the ultimate destination, the checksum using the obtained from the header carried the UDP message: vette rue that te ae ees, then? nation host aS puke hes ected the intended destnai os well as the correct protocol Por, destination of the IP pa within ocanneg witn Carrstan User Interface : . ae i ation A user interface should allow the creation of new receive ports, eee scasees, a were Teeeiyg ports that return the data octets and an indication of source port ca inate! ports alad resent that allows a datagram to be sent, specifying the data, source and destina ston sent. Lletled tion Internet addresses a ination a a © The UDP module mist be able to determine the source and destinal ad th protocol field from the Internet header. datagram including th il face Wo the whole Interne 4 1¢ Chiirg + One posible UDPAP ies seal Gach an interface would also allow the UDp i, Internet header in response to a receive oper! “ ata vith header to the IP (0 sel pass a full Internet datagram complete with he aa irc © The IP would verify certain fields for consistency Protocol Applicatio ‘The major uses of this prot Protocol Number : This is protocol 17 (21 octal) when used in the Internet Protocol. focol are the Internet Name server, and the Trivial File Transfer, A.2.4 UDP Operation: ‘The UDP uses concepts that, are common to the transport layer. We will discuss the following concept in brief : 1. Connectionless services. 2. Flow control and error control. 3. Encapsulation and Decapsulation. 4° Queuing. 4. Connectionless Services : © UDP provides a connectionless service. That means eac independent datagram. «All the user datagrams are totally independent of each other even though they are emerzing from the same Source process and going to the same destination process. These datagrams are not numbered. No connection establishment or co (termination is necessary. Each datagram can follow a different path. 2. Flowand error control: ~ a UDP is a simple, unreliable protocol. There is no flow control, hence the recei overflow with incoming messages. UDP does not support any error control mechanism, except for the checksum. The sender does not know if the message is lost or duplicated. If the receiver detects any error through the checksum, then that datagram is discarded, 3, Encapsulation and decapsulation : _ The UDP encapsulates and decapsulates messages in an IP datagram i a tal message ‘iota ote ps fo the other’ \gram in order to send the n 4, Queuing: In UDP, queues are associated with ports as shown in Fig. A.2.3. +h user datagram sent by UDP is an mnection release ° iver cal ocanned with Vamocan = co ott Day time cllont (| Ony tron eoryar Incoming ong ousgg 7 nue Oungoing Inoomieg mt queua aFig, A.23 : Queues in UDP s at the client site by requesting a port pak number fro « seat both an incoming and outgoing quence wevcned econ Same ciate ch process start A pre ntai imp! ss gets only one port number and hence one outgoing and another incomi other incoming qe ny ion a 7 Brey Pees function as long as the process is running, They are destroyed as soon as th on as the process « qhe que ister rocess can send’ message 10 its outgoi eat mutgoing queue by usi / ed te request. iB «I by using the source port number 5p removes the queue ———- one by one by adding the UDP header and delivers them to IP. ' uigoing queue overflows, then operating system tells that ch it | Hethe tie next message. client process to wait before client receives a message, UDP checks if the incoming queue has bei n creat cas been created, then the UDP sends the received datagram tothe end of peda trahe queue is not present then UDP will simply discard the user datagram. If the incoming the eons, ten UDP discard the user datagram and aranges to send th pr uravaible Arssage to the server. ‘The mechanism to create thi outgoing queues using its we when the ifthe queus e server queue is different. The server asks for the incoming and 11: known port as soon as it starts running. The queues exist as long as the server is running. 3 | When a message is received at the server, the UDP checks if the incoming queue has been created or not. UDP «ifthe que is not present, the UDP discards the user datagram. I the queue i Present then sends the datagram at the end of the queue. + If the incoming queue overflows, then ‘UDP drops the user datagram and arranges to send the port unavailable message to the client. + When the server wants to send a message to client it sends that Tse messages are then removed one by one after adding the U system will ask the server to wait before t message to the outgoing queue: IDP header. They are delivered to * If the outgoing queue overflows then the operatin sending the next message. ‘ AQ5 Applications of UDP : of TCP and UDP with examp 5) that have the fo ie is suitable forthe applications (proces Howing requirements = A simple response to request made. e Flow and error controls not essential. Bulk data is not to be sent (like FTP). Scanned with CamScan A3__ Transmission Control Protoco Pete (0 ec. 13, 3, 3 Mary A.3.1 = UDP is suita wr i table for the processes having intemal flow and error control mechanisms, gy” ations, UDP is suitable for the multicasting appl uch as SNMP. UDP is used for management processe: UDP is used for RIP (Routing Information Protocol). ae ‘Write short notes on TCP. im is connection orieaay The internet has two main protocols and the other one supports the connectionles TCP (Transmission control protocol) is 2 co! Protocol ) is the connectionless protocol. UDP is basically just IP with an additional short header. 1 The TCP provides reliable transmission of data in an TP-environment. TCP corresponds tothe transport layer (Layer 4) of the OSI reference model, a ‘Among the services TCP provides are stream data transfer, reliability, efficient flow control, yy, duplex operation, and multiplexing. ; 3 vs an unstructured stream of bytes identified by sequence With stream data transfer, TCP deliver tochop data’ into blocks before numbers. ‘This service benefits applications because they do not have bytes into segments and passes them to IP for handing it off to TCP. Instead, TCP groups delivery. ; TCP offers reliability’ by through an internetwork. bytes:with a forwarding acknowl * It does this by sequencing destination the next byte the source expects to receive. Bytes not acknowledged within a specified time period are retransmitted. The reliability mechanism of TCP allows devices to deal with lost, delayed, duplicate, ot misread packets. A time-out mechanism allows devices o detect lost packets and request retransmission. TCP offers efficient flow control, which means that, when sending acknowledgments back to the Source, the receiving TCP process indicates’ ihe highest sequence mumber that it cen receive without overflowing its internal buffers. Full-duplex operation means that TCP processes can both send and receive at the same time. Finally, TCP's multiplexing means that numerous simultaneous upper-layer conversations cam be multiplexed over a single connection. TCP Services : : jon layer = ing are some of the services offered by TCP to the processes at the applicati 2. Sending and receiving buffers 4. Full duplex service 6, Reliable service. fhe transport layer. ‘One of thet iss service. nnection oriented protocol and UDP (User Dat, — providing connection-oriented, end-to-end reliable packet delivery jédgment number that indicates to the Followit 1. Stream delivery service 3. Bytes and segments 5. Connection oriented service 7. Process to process communication. Process to process communication : The TCP uses port numbers a transport layer addresses. Table A.3.1 shows some ve known port numbers used by TCP. ocanned Wit Galnocalr off ifn application cai t YF vote ana i PP "use both UDP and TCP, the same port mumber is assigned 10 plication. ¢ nis aP! ble A.3.1: / Table A.3.1 : Well known ports used by TCP Protocol Dever & [ces sed datagram bak o sender — [Disard _ baa Feceived datagram [Daytime | [ Returns the date andthe ine ———— ‘Chargen Returns a string character FTP, Data File Transfer Protocol (data connection) FTP, Control File Transfer protocol (control connection) TELNET Terminal network SMTP Simple Mail Transfer Protocol DNS Domain Name server BOOTP Bootstrap Protocol [Finger Finger | TTP Hypertext Transfer Protocol vit RPC Remote Procedure Call am delivery service : a TCP isa stream oriented protocol. It allows the sending process to deliver data as a stream © Gfbytes and the receiving process to obtain data as a stream of bytes. TCP creates a working environment in such a way that the sending and receiving processes * seem to be connected by-an imaginary “tube” as shown in Fig. A.3.1. This is called as stream. delivery service. Sending process a Recelving process Imaginary tube carrying the dala stream, (c-o2Fig, A.3.1: Stream delivery service Sending and receiving buffers : * The sending and receiving proces: * Hence TCP needs buffers for storage, There direction : 1. Sending buffer : 2. ivi . i as shown in + A butar con be implemented by using a ccalar amy of 1 byte Toeaion Fig. A.3.2. receive data at the same speed. jot produce and s ae thet are two types of buffers used in each ocanned with Vamocan 4. Somputer Networks (PTU) TOP and Upp the butt ha, , the sending Fig, A3.2 shows the movement of data in one direction o” three types of locations 1. Enipty locations 2, Locations containing t bytes are kept in the bu ‘The locations containing the by Sonding process gent but not acknowledged, They Ht ceived. ment is received: he sending TCP. scaiving process re bytes which have POX fer till an acknowl le : Aes (0 bes a 3. ‘Sending TOP 7 1 Empty locations Empire od Byt hut aoknowedgoren {Gy Leovations containing ype a isnot received. 7 ing buffers siding and receivi - only a part of data which is to be sent, due to ‘ion in the network. Bytes to be sont : (Gan Fig, A3.2: Se In practice, the TCP may be able to send slowness of the receiving process or congest “The buffer at the receiver is divided into two parts °° L The part containing empty. locations. i 2. The part coittaining-the received ‘bytes which process. can be consumed by the sending Bytes and segments : Buffering is used to handle the difference between the speed of data transmission and data consumption. ; But only buffering is not enough. We need one more step before sending the’ data. The IP layer, as a service provider for TCP, needs to send data in the form of packets and not as a stream of bytes. At the transport layer, TCP groups a‘number of bytes together into a packet called a segment. a — bam sol a for the purpose of exercising control. st te a othe resving posse a then transmitted. The entire me a ts may be received out of order, lost or corrupted when it reaches the receiving Fig. A3.3 shows how segments are created from the bytes in the buffers. © 508 : ‘ tes. The segments are not of the same size. Each Segment can carry hundreds of reds of bytes. ocanned Wit Galnocar wv ‘Sending process $$ s pono 4 Recelving process ‘Sending TOP Recehing TCP . Full duplex service : Gaykig AIS « TCP offers full. duj ri multaneously. plex service where the dat simultaneously. ta can flow in both the directions «Each TCP will then have a sending buffer and receivi 1. The TCP segments are seni E asendiny ivi ill the 1g, and receiving buffer. CP sei a Connection oriented service : . TCP is a connection ori receive) with eae ee ‘When process — 1 wants to communicate (send and 1. TCPof. : srocess - 2), the sequence of operations is a8 follows = a of process — 1 informs TCP of process — 2 and gets its approval 2. ‘CP of process ~ 1 and TCP of process ~ 2 exchange data in both the directions. 3, After completing the data exchange, ‘when buffers on both sides are empty.the two TCPs distroy their buffers. ; «The type of connection in TCP is not physical, it is virtual. The TCP segment is encapsulated in an JP datagram and can be sent out of order. . These segments can get ost or corrupted and may have to be resent. «Each segment may take a different path to reach the destination. Reliable service : 7 TCP is a reliable transport protocol.;Jt-uses.an acknowledgement mechanism for checking the safe and sound arrival of data. A3.2 TCP. Features: © f mitted or received, there 18 n° field for Byte numbers : ‘The TCP software keeps track of the segments being tran: a segment number value. But there are fields called sequence - Note that these fields correspond to acknowledgement number. number and the the byte number and not the segment number. TCP numbers all the data bytes which are transmitted, The numbering is independent in each direction. ‘The numbering do between 0 and2—1. il y t es not always start from 0, but it can start with a randomly generated number dcanneu wiurCamStar Sequence number : : + After numbering the bytes, the TCP assigns a sequence number to each segment that js bj, transmitted, + The sequence number for each segment isthe number of the first Byte carried in that segmen, Acknowledgement number : . The TCP communication is duplex. So both the same time, © Each party numbers the bytes with a different starting byte number. : © Each party also uses an acknowledgement number (0 confirm te bytes it has received. The acknowledgement number is cumulative i.c. the receiver takes the number of the last iy, received, adds | to it and announces this sum as the acknowledgement number. Flow control: ©. TCP provides sent by the sender. ©) This will avoid data overflow at involved parties can send and receive data ati, low control (UDP does not). The receiver will control the amount of data to by the receiver, The TCP uses byte oriented flow control, Error control : - ; uilt for TCP. This allows TCP to provide a reliable service, . The error control mechanism is inb c : The error control mechanism considers a segment as the unit of data for error correction but the error contro] is byte oriented. Congestion control : : 7 «TCP takes the congestion in network into account. UDP does not do this, . ¢- The amount of data sent by the sender depends on the following factors: 1. ~The receivers decision (flow control). auto 2. The network congestion, 3.3 The TCP Protocol : Let us take a general overview of the TCP protocol, it sequence number. These numbers are used «Every byte on a TCP connection has its own 32+ for both acknowledgement and for window mechanism. Segments : © The sending an d receiving TCP entities exchange data in the form of segments. A segment consists of a fixed 20 byte header (plus and optional part) followed by zero or more data bytes. Segment size : The segment size is decided by the TCP software. ‘Two limits ‘restrict’ the segment size a8 follows : . 1. Each segment including the TCP header, must fit in the 65535 byte IP payload. 2: Each segment must fit in the MTU (maximum transfer unit). Each network has 3 maximum transfer unit. Practically an MTU which is a few thousand bytes defines the upper limit on the segment size, scanned witn Lamscar comb Ca : f cent is too large, then it st it "ase should be broken into small segments. Using fragmentation by @ segment gets a new IP header. So the fragmentation by router will increase ‘ Ph So the fr i MN i the outer: ach ew + gyerhead. : face] used bY ae tf protocol used by TCP entities is the sliding window protocol. A sender starts a timer as sender transmits a segment. it is recaned by the destination, it sends back acknowledgement alongwith data igement number is equal to the next sequence number it expects to receive. before the acknowledgement reaches back, it will retransmit nel . Ta pe basic * goon asa When the segment © gany. The acknowl yf the timer at the sender goes out * that segment again. sible problems : ‘As the segments can be fragmented, a part of the transmitted segment only may reach the destination with the remaining part lost. . its can arrive out of order. conte! it and unnecessary retransmis . Segment Segments can get delayed so much that timer is out place. Ifa retransmitted segment takes a different'route’than the origifial se fragments of original and retransmitted segments can’ teach the’destination ina careful administration is required to achieve reliable byte stream. There is a possibility of congestion or broken network along the path. ‘TCP should be able to solve these problems in an efficient manner.: . A34 TCP Segment : ‘The TCP segment as shown in Fig. ‘A3.4 consist 1. Header 2. »Data Po: ission will take gment is fragmented then the sporadic way. So s of two parts.: (G-1423) Fig. A3.4 TCP segment The TCP segment header: 2.20 byte fixed format Fig. A.3.5 shows the layout of a TC header. The fixed header may be followed by header options. 65535 = 20 -20= 654! orrespond to the TCP header. . ‘After the options, if any, upto 20 bytes correspond to the IP header and the next 20 ct 4 for sending the acknowledgements The TCP segment without data are use messages. . P segment. Every segment begins with 195 data bytes may follow. Note that the first and control Scanned with CamScan 82 bits (4 Bytos) Sequence number TCP header TCP header eserved Window length vege Padding is portion (0 or more 32 - bit words) ti onal port DATA (optional) i (op : ais L (o-o1Fig, A.3.5 : TCP header format Source port : ed from within th A 16-bit number identifying the application the TCP segment originat < host. The port numbers are divided into three ranges; «well-known ports (O through 1023), Tetisers ports (1024 through 49151) and private ports (49152. ee ESO Port assignments are used by T¢p as an interface to the application layer... -: Destination port : fi NAD OMY A 16-bit number identifying the spit the TCP segment is destined for on a receiving hog Destination ports use the same port number assignments as those set aside for source ports. ‘Sequence number : i A 32-bit number identifying the current position of the first data byte in the segment within te entire byte stream for the TCP connection. After reaching 2°? — 1, this number will wrap around to 0. Acknowledgement number : oi A 32-bit number identifying the next data byte the sender expects from the receiver. Therefor, the number will be one greater than 'the most recently received data byte. This field is only used when the ACK control bit is tuned on. Header length or offset : A 4-bit field that specifies the total TCP header length in 32-bit words (or in multiples of 4 bytes if you prefer). Without options, a TCP header is always 20 bytes in length. The largest a TCP headkt may be is 60 bytes. This field is required because the size of the options field(s) cannot be determined it advance. Note that this field is called "data offset". in the official TCP standard, but header Iength is more commonly used. Reserved : A 6-bit field currently unused and reserved for future use, ocanned with Camocar Y “al pits or flags : ort rgent pointer (URG) : I inter field. jledgement (ACK) : If this bit field i ‘Acknowledgement (ACK) : If this bit ficld is set, the acknowledgement field described earlier is IE this bi i it field is set; the receiving TCP should interpret the urgent valid ion @ push function (PSH) : If this bit field is set, the receiv. . meiving application as soon as possible. An ezaualel Shlain Fe ioe tee EREAK request fo an application, which ean jump ahend ot queued decent Come Reset the connection (RST) : If this bit is resent, ad of quened data aborting the connection and all queued data and ‘allocated ater fot fe cies ke bones relinquished. a uiffers for the connection can be freely «nchronize (SYN) : Wher is bi ‘pnt cronies’) soqhtnce eet is bit Hed signifies that sender is attempting to y 5. is u i init i "Sprishment between a sender and receiver, used during the initial stages of connection «No more data from sender (FIN) : If set, this bit field tells the receiver that th h yeached the end of its byte stream for the current TCP connection. ees window = 5 ; ‘A 16-bit integer used by TCP for flow control in the form of a data transmission window size. ‘This number tells the sender how much. data the receiver is willing to accept. The maximum value for this field would limit the window size to 65,535 bytes, however a "window scale" option can be used 10 make use of eyen larger windows. 408 / Checksum : n h 4 wh ‘A TCP sender computes a value based on, the contents of the. TCP header and data fields. This 16-bit value will be compared with the value the receiyer generates using the same computation. If the values match, the receiver can be very confident that the segment arrived intact. Urgent pointer : fe ft Zi In certain circumstances, it’ may be'necessary for a'TCP sender to notify the receiver of urgent data that should be processed by the receiving application as soon as possible. This 16-bit field tells the receiver when the last byte of urgent data in the segment ends. Options : In order to provide additional functionality, several optional parameters may be used between a ‘TCP sender and receiver. Depending on the option(s) used, the leigth of this field will vary in size, but it cannot be larger than 40 bytes due to the size of the header length field (4 bits) The most common option is the maximum segment size (MSS) option. A’TCP receiver tells the TCP sender the maximum segment size it is willing to accept through the use of this option. Other options are often used for various flow control and congestion control techniques. Padding : Because options may vary in size, it may be necessary to, "pad" the TCP header with zeros so that the segment ends on a 32-bit word boundary as defined by the standard, Data : ‘Although not used in some circumstances (e.g. acknowledgement segments with no data in the reverse direstion), this variable length field carries the application data from ‘TCP sender to receiver. ‘This field coupled with the TCP header fields constitutes a TCP segment. Scanned with CamScan A.3.5 Checksum : EERIE, | Explain um. : is checksum ? . A checksum is provided to ensure extreme reliability. Tt checksums tl conceptual pseudo header shown in Fig. A.3.6. }—_+__——_ 32 bits. aout Source address he header, the data and q, e Destination address pt eo juded in the TCP checksum (e-oinFig, A.3.6 : The pscudo header incl 7 When the checksum is being computed, the TCP checksum field is set to zero, and the data felg is padded out with an additional zero byte ifits length is 28 ‘odd number. ement and then 1’s complement of the sum is Then all the 16 bit words are added in 1’s comp! taken to get the checksum. ’ calculation on the entire segment in Wher a receiver performs the result has to be zero. «The pseudo header contains the 32 bit IP address of the source and destination machines, the protocol number for TCP i.e. 6 and the TCP segment Iength as shown in Fig. A.3.6. Relationship Between TCP and IP : «The relationship between TCP and IP is very interesting, Each TCP message gets encapsulated in an IP datagram and then this datagram is sent across the Internet. IP transports this datagram from sender to destination, without’ bothering about the contents of the TCP message. ‘At the final destination the IP hands over the message to the TCP software running on the destination computer. IP acts like a postal service and transfers the datagrams from one computer to the other. Thus TCP deals with the actual data to be transferred and IP takes care of transfer of data, Many applications such as FTP, Remote login TELNET etc. keep sending data to TCP software on the sending computer. The TCP software acts as a multiplexer at the sending computer. It receives data from various applications, multiplexes the data and hands it over to the IP software at the sending end as shown in Fig. A.4.1. cluding the checksum field, the ‘Application programs at the sond (cde) Fig, Aid1: Multiplexing and demultiplexing using "CP Scanned with CamScan ot Ore ‘own header to this TCP packey $$ 7 7 ito ports an id Sockets Scanned with CamScan

You might also like