SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
8.1
Chapter 8
Transport Layer:
UDP and TCP
 Computer Networks
 Al-Mustansiryah University
 Elec. Eng. Department College of Engineering
Fourth Year Class
8.2
8-1 PROCESS-TO-PROCESS DELIVERY
The transport layer is responsible for process-to-process
delivery—the delivery of a packet, part of a message,
from one process to another. Two processes
communicate in a client/server relationship, as we will
see later.
8.3
•Connection-oriented Requires a session connection (analogous to a phone
call) be established before any data can be sent. This method is often called a
"reliable" network service. It can guarantee that data will arrive in the same
order. Connection-oriented services set up virtual links between end systems
through a network.
•Connectionless Does not require a session connection between sender and
receiver. The sender simply starts sending packets (called datagrams) to the
destination. This service does not have the reliability of the connection-oriented
method, but it is useful for periodic burst transfers.
8.4
8-2 USER DATAGRAM PROTOCOL (UDP)
The User Datagram Protocol (UDP) is called a
connectionless, unreliable transport protocol. It does not
add anything to the services of IP except to provide
process-to-process communication instead of host-to-
host communication.
8.5
Figure 8.9 User datagram format
8.6
Example 1 :The following is a dump of a UDP header in hexadecimal format.
CB84000D001C001C
a. What is the source port number?
b. What is the destination port number?
c. What is the total length of the user datagram?
d. What is the length of the data?
8.7
Solution:
a. The source port number is the first four hexadecimal digits (CB84), which
means that the source port number is 52100.
b. The destination port number is the second four hexadecimal digits (000D),
which means that the destination port number is 13.
c. The third four hexadecimal digits (001C) define the length of the whole UDP
packet as 28 bytes.
d. The length of the data is the length of the whole packet minus the length of the
header, or 28 – 8 = 20 bytes.
8.8
UDP length
= IP length – IP header’s length
Note
8.9
8-3 TCP
TCP is a connection-oriented protocol; it creates a
virtual connection between two TCPs to send data. In
addition, TCP uses flow and error control mechanisms
at the transport level.
8.10
The bytes of data being transferred in
each connection are numbered by TCP.
The numbering starts with a randomly
generated number.
Note
8.11
Example 2 :Suppose a TCP connection is transferring a file of 5,000 bytes. The first
byte is numbered 10,001. What are the sequence numbers for each segment if data are
sent in five segments, each carrying 1,000 bytes?
8.12
The value in the sequence number field
of a segment defines the
number of the first data byte
contained in that segment.
Note
8.13
The value of the acknowledgment field
in a segment defines
the number of the next byte a party
expects to receive.
The acknowledgment number is
cumulative.
Note
8.14
Figure 8.16 TCP segment format
8.15
Source port address. This is a 16-bit field that defines the port number of the
application program in the host that is sending the segment
Destination port address. This is a 16-bit field that defines the port number of the
application program in the host that is receiving the segment
Sequence number. This 32-bit field defines the number assigned to the first byte of data
contained in this segment
Acknowledgment number. This 32-bit field defines the byte number that the receiver
of the segment is expecting to receive from the other party. If the receiver of the segment
has successfully received byte number x from the other party, it returns x + 1 as the
acknowledgment number.
8.16
Header length. This 4-bit field indicates the number of 4-byte words in the TCP
header. The length of the header can be between 20 and 60 bytes. Therefore, the value
of this field is always between 5 (5* 4= 20) and 15 (15 * 4= 60).
Reserved. This is a 6-bit field reserved for future use.
Control. This field defines 6 different control bits or flags
Window size. This field defines the window size of the sending TCP in bytes. Note
that the length of this field is 16 bits, which means that the maximum size of the
window is 65,535 bytes.
Checksum. This 16-bit field contains the checksum
Urgent pointer. This 16-bit field, which is valid only if the urgent flag is set, is used
when the segment contains urgent data
8.17
Table 8.3 Description of flags in the control field
8.18
Flow Control
Flow control assists the reliability of TCP transmission by
adjusting the effective rate of data flow between the two services
in the session. Window Size field in the TCP header specifies the
amount of data that can be transmitted before an
acknowledgement must be received.
8.19
Figure 8.18 Connection establishment using three-way handshaking
8.20
A SYN segment cannot carry data, but it
consumes one sequence number.
A SYN + ACK segment cannot
carry data, but does consume one
sequence number.
An ACK segment, if carrying no data,
consumes no sequence number.
8.21
Figure 8.19 Data transfer
8.22
Figure 8.20 Connection termination using three-way handshaking
8.23
The FIN segment consumes one
sequence number if it does
not carry data.
The FIN + ACK segment consumes
one sequence number if it
does not carry data.
8.24
Figure 8.22 Sliding window
rwnd = buffer size − number of waiting bytes to be pulled
8.25
What is the value of the receiver window (rwnd) for
host A if the receiver, host B, has a buffer size of 5000
bytes and 1000 bytes of received and unprocessed data?
Example 8.4
Solution
The value of rwnd = 5000 − 1000 = 4000. Host B can
receive only 4000 bytes of data before overflowing its
buffer. Host B advertises this value in its next segment
to A.
8.26
What is the size of the window for host A if the value of
rwnd is 3000 bytes and the value of cwnd is 3500 bytes?
Example 8.5
Solution
The size of the window is the smaller of rwnd and cwnd,
which is 3000 bytes.
8.27
TCP UDP
Connection
TCP is a connection-oriented
protocol.
UDP is a connectionless protocol.
Ordering of
data packets
TCP rearranges data packets in
the order specified.
UDP has no inherent order as all
packets are independent of each
other.
Speed of
transfer
The speed for TCP is slower
than UDP.
UDP is faster because there is no
error-checking for packets.
Reliability
There is absolute guarantee
that the data transferred
remains intact and arrives in
the same order in which it was
sent.
There is no guarantee that the
messages or packets sent would
reach at all.
Header Size TCP header size is 20 bytes UDP Header size is 8 bytes.
8.28
TCP UDP
Streaming
of data
Data is read as a byte stream, Packets are sent individually
Data Flow
Control
TCP does Flow Control. TCP
requires three packets to set up a
socket connection,
UDP does not have an option for
flow control
Acknowle
dgement
Acknowledgement segments No Acknowledgment

Contenu connexe

Tendances (20)

Tcp/ip
Tcp/ipTcp/ip
Tcp/ip
 
Networking devices
Networking devicesNetworking devices
Networking devices
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
TCP/IP Introduction
TCP/IP IntroductionTCP/IP Introduction
TCP/IP Introduction
 
Presentation on arp protocol
Presentation on arp protocolPresentation on arp protocol
Presentation on arp protocol
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)
 
Bridge
BridgeBridge
Bridge
 
Osi reference model
Osi reference modelOsi reference model
Osi reference model
 
Tcp
TcpTcp
Tcp
 
Presentation on TCP/IP Model
Presentation on TCP/IP ModelPresentation on TCP/IP Model
Presentation on TCP/IP Model
 
Token ring
Token ringToken ring
Token ring
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
 
IPv4
IPv4IPv4
IPv4
 
TCP Vs UDP
TCP Vs UDP TCP Vs UDP
TCP Vs UDP
 
Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing
 
Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
 
Tcp/ip model
Tcp/ip  modelTcp/ip  model
Tcp/ip model
 

Similaire à Transport layer udp and tcp network

04 MK-PPT End-to-End Protocols.ppt
04 MK-PPT End-to-End Protocols.ppt04 MK-PPT End-to-End Protocols.ppt
04 MK-PPT End-to-End Protocols.pptdhivyak49
 
20CS2007 Computer Communication Networks
20CS2007 Computer Communication Networks 20CS2007 Computer Communication Networks
20CS2007 Computer Communication Networks Kathirvel Ayyaswamy
 
Transport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptxTransport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptxAnkitKumar891632
 
UNIT IV-Transport Layer.pptx
UNIT IV-Transport Layer.pptxUNIT IV-Transport Layer.pptx
UNIT IV-Transport Layer.pptxLAVANYAsrietacin
 
Transport layer
Transport layer   Transport layer
Transport layer AnusuaBasu
 
REMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & AnomaliesREMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & AnomaliesRhydham Joshi
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer ProtocolsZahouAmel1
 
LECTURE-Transport-Layer_lec.ppt
LECTURE-Transport-Layer_lec.pptLECTURE-Transport-Layer_lec.ppt
LECTURE-Transport-Layer_lec.pptMonirHossain707319
 

Similaire à Transport layer udp and tcp network (20)

04 MK-PPT End-to-End Protocols.ppt
04 MK-PPT End-to-End Protocols.ppt04 MK-PPT End-to-End Protocols.ppt
04 MK-PPT End-to-End Protocols.ppt
 
20CS2007 Computer Communication Networks
20CS2007 Computer Communication Networks 20CS2007 Computer Communication Networks
20CS2007 Computer Communication Networks
 
Transport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptxTransport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptx
 
transport layer
transport layertransport layer
transport layer
 
Unit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptxUnit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptx
 
計概
計概計概
計概
 
Osi model
Osi modelOsi model
Osi model
 
Transport layer.pptx
Transport layer.pptxTransport layer.pptx
Transport layer.pptx
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
Lec6
Lec6Lec6
Lec6
 
unit 3 ns.ppt
unit 3 ns.pptunit 3 ns.ppt
unit 3 ns.ppt
 
UNIT IV-Transport Layer.pptx
UNIT IV-Transport Layer.pptxUNIT IV-Transport Layer.pptx
UNIT IV-Transport Layer.pptx
 
Transport layer
Transport layer   Transport layer
Transport layer
 
Cs8591 u4
Cs8591 u4Cs8591 u4
Cs8591 u4
 
REMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & AnomaliesREMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
 
TCP/IP & UDP
TCP/IP & UDPTCP/IP & UDP
TCP/IP & UDP
 
Mod4
Mod4Mod4
Mod4
 
LECTURE-Transport-Layer_lec.ppt
LECTURE-Transport-Layer_lec.pptLECTURE-Transport-Layer_lec.ppt
LECTURE-Transport-Layer_lec.ppt
 
11 atm
11 atm11 atm
11 atm
 

Dernier

Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxchumtiyababu
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxNadaHaitham1
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 

Dernier (20)

Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 

Transport layer udp and tcp network

  • 1. 8.1 Chapter 8 Transport Layer: UDP and TCP  Computer Networks  Al-Mustansiryah University  Elec. Eng. Department College of Engineering Fourth Year Class
  • 2. 8.2 8-1 PROCESS-TO-PROCESS DELIVERY The transport layer is responsible for process-to-process delivery—the delivery of a packet, part of a message, from one process to another. Two processes communicate in a client/server relationship, as we will see later.
  • 3. 8.3 •Connection-oriented Requires a session connection (analogous to a phone call) be established before any data can be sent. This method is often called a "reliable" network service. It can guarantee that data will arrive in the same order. Connection-oriented services set up virtual links between end systems through a network. •Connectionless Does not require a session connection between sender and receiver. The sender simply starts sending packets (called datagrams) to the destination. This service does not have the reliability of the connection-oriented method, but it is useful for periodic burst transfers.
  • 4. 8.4 8-2 USER DATAGRAM PROTOCOL (UDP) The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol. It does not add anything to the services of IP except to provide process-to-process communication instead of host-to- host communication.
  • 5. 8.5 Figure 8.9 User datagram format
  • 6. 8.6 Example 1 :The following is a dump of a UDP header in hexadecimal format. CB84000D001C001C a. What is the source port number? b. What is the destination port number? c. What is the total length of the user datagram? d. What is the length of the data?
  • 7. 8.7 Solution: a. The source port number is the first four hexadecimal digits (CB84), which means that the source port number is 52100. b. The destination port number is the second four hexadecimal digits (000D), which means that the destination port number is 13. c. The third four hexadecimal digits (001C) define the length of the whole UDP packet as 28 bytes. d. The length of the data is the length of the whole packet minus the length of the header, or 28 – 8 = 20 bytes.
  • 8. 8.8 UDP length = IP length – IP header’s length Note
  • 9. 8.9 8-3 TCP TCP is a connection-oriented protocol; it creates a virtual connection between two TCPs to send data. In addition, TCP uses flow and error control mechanisms at the transport level.
  • 10. 8.10 The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number. Note
  • 11. 8.11 Example 2 :Suppose a TCP connection is transferring a file of 5,000 bytes. The first byte is numbered 10,001. What are the sequence numbers for each segment if data are sent in five segments, each carrying 1,000 bytes?
  • 12. 8.12 The value in the sequence number field of a segment defines the number of the first data byte contained in that segment. Note
  • 13. 8.13 The value of the acknowledgment field in a segment defines the number of the next byte a party expects to receive. The acknowledgment number is cumulative. Note
  • 14. 8.14 Figure 8.16 TCP segment format
  • 15. 8.15 Source port address. This is a 16-bit field that defines the port number of the application program in the host that is sending the segment Destination port address. This is a 16-bit field that defines the port number of the application program in the host that is receiving the segment Sequence number. This 32-bit field defines the number assigned to the first byte of data contained in this segment Acknowledgment number. This 32-bit field defines the byte number that the receiver of the segment is expecting to receive from the other party. If the receiver of the segment has successfully received byte number x from the other party, it returns x + 1 as the acknowledgment number.
  • 16. 8.16 Header length. This 4-bit field indicates the number of 4-byte words in the TCP header. The length of the header can be between 20 and 60 bytes. Therefore, the value of this field is always between 5 (5* 4= 20) and 15 (15 * 4= 60). Reserved. This is a 6-bit field reserved for future use. Control. This field defines 6 different control bits or flags Window size. This field defines the window size of the sending TCP in bytes. Note that the length of this field is 16 bits, which means that the maximum size of the window is 65,535 bytes. Checksum. This 16-bit field contains the checksum Urgent pointer. This 16-bit field, which is valid only if the urgent flag is set, is used when the segment contains urgent data
  • 17. 8.17 Table 8.3 Description of flags in the control field
  • 18. 8.18 Flow Control Flow control assists the reliability of TCP transmission by adjusting the effective rate of data flow between the two services in the session. Window Size field in the TCP header specifies the amount of data that can be transmitted before an acknowledgement must be received.
  • 19. 8.19 Figure 8.18 Connection establishment using three-way handshaking
  • 20. 8.20 A SYN segment cannot carry data, but it consumes one sequence number. A SYN + ACK segment cannot carry data, but does consume one sequence number. An ACK segment, if carrying no data, consumes no sequence number.
  • 22. 8.22 Figure 8.20 Connection termination using three-way handshaking
  • 23. 8.23 The FIN segment consumes one sequence number if it does not carry data. The FIN + ACK segment consumes one sequence number if it does not carry data.
  • 24. 8.24 Figure 8.22 Sliding window rwnd = buffer size − number of waiting bytes to be pulled
  • 25. 8.25 What is the value of the receiver window (rwnd) for host A if the receiver, host B, has a buffer size of 5000 bytes and 1000 bytes of received and unprocessed data? Example 8.4 Solution The value of rwnd = 5000 − 1000 = 4000. Host B can receive only 4000 bytes of data before overflowing its buffer. Host B advertises this value in its next segment to A.
  • 26. 8.26 What is the size of the window for host A if the value of rwnd is 3000 bytes and the value of cwnd is 3500 bytes? Example 8.5 Solution The size of the window is the smaller of rwnd and cwnd, which is 3000 bytes.
  • 27. 8.27 TCP UDP Connection TCP is a connection-oriented protocol. UDP is a connectionless protocol. Ordering of data packets TCP rearranges data packets in the order specified. UDP has no inherent order as all packets are independent of each other. Speed of transfer The speed for TCP is slower than UDP. UDP is faster because there is no error-checking for packets. Reliability There is absolute guarantee that the data transferred remains intact and arrives in the same order in which it was sent. There is no guarantee that the messages or packets sent would reach at all. Header Size TCP header size is 20 bytes UDP Header size is 8 bytes.
  • 28. 8.28 TCP UDP Streaming of data Data is read as a byte stream, Packets are sent individually Data Flow Control TCP does Flow Control. TCP requires three packets to set up a socket connection, UDP does not have an option for flow control Acknowle dgement Acknowledgement segments No Acknowledgment