Lecture Slides 74-89

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

3/27/2013

Transport Layer and associated


protocols

74

At level three (Network Layer), what have we


got!
• Up to this point we have established:
– Logical addressing and distribution
– Route discovery and processing
– Hop-by-Hop (network by network) processing
• However, our IP based system is
– Connectionless
– Unacknowledged
– And thus unreliable
• Transport layer’s responsibilities are to handle some
of these issues

75

1
3/27/2013

Transport layer protocols


• Transmission control protocol (TCP) and User datagram
protocol (UDP) are the two major transport layer protocols
• This lecture is focused at highlighting the significance of each
of these protocols
• The services they offer
• The significance of various fields in the headers
• The working mechanism of each service offered by TCP

76

TCP interaction

• TCP operates in a client-server architecture


• A server (a program) offers its services over a network
• A client (which is also a program) requests the use of those
services
• Iterative servers
• Concurrent servers
77

2
3/27/2013

TCP – what does it offer?


• TCP offers connection-oriented, reliable and byte-stream
transport service
• Connection-oriented transfer
– A connection is established prior to actual transmission of
data
– A connection means that a server has agreed(Ack) to serve
a client’s requests for the services that it offers
– TCP has a ‘famous’ three-way handshake mechanism for
connection establishment

78

TCP – what does it offer?


• Reliable transfer
– Application data is divided into small sized chunks with a
higher probability of successful delivery over a network
(fragmentation)
– Fragmentation is followed by reassembly process on a TCP
peer
– Received segments are Acknowledged by TCP peers
– A missing ACK depicts loss of previously sent segment
– TCP uses timers to track the ACKs and sent segments
– A recovery (retransmission) policy is invoked in case of a
TCP level loss
– Maintains a checksum on data and header for end to end
reliable transfer
79

3
3/27/2013

TCP – what does it offer?


• In order delivery to higher layers from potentially out of order
reception of segments
• Duplicate segment detection and removal
• Flow & Congestion control- telling one end how much the
other end can afford
• Multiplexing of outbound application data
• De-multiplexing of inbound data to rightful applications using
ports

80

Quiz-5
1. Explain the working mechanism of the traceroute
application

2. Fragmentation is an important process in a TCP/IP


based network. Why do we need fragmentation and
what are the potential disadvantages associated with
fragmentation

81

4
3/27/2013

TCP Header – the first step!

82

The Ports story


• Transport layer protocols use port numbers for multiplexing
• Data may be exchanged between two stations by several
different network applications, e.g. email, web server, etc
• Stations can be identified through their IP address and data
delivered as a whole
• To deliver it to the rightful application between peers, another
identifier is required along with IP (Network) address
• Port number identifies a source and destination application
service
• The combination of source IP address, source port number
and destination IP address, destination port number forms a
socket

83

5
3/27/2013

The Ports story

• Socket has to be unique


• Server’s port numbers should be well-known
• Clients port numbers can be selected randomly

84

The Ports story


• Three ranges of port numbers
• Well known port numbers are from 0 through 1023
• Registered ports are from 1024 through 49151
• The Dynamic and/or Private Ports are those from 49152
through 65535
• The port numbers used by clients are called empirical port
numbers
• Most implementation use ports between 1024 to 5000 as
empirical ports
• Managed by Internet Assigned Numbers Authority (IANA)

85

6
3/27/2013

TCP Header – rest of the fields!


•The sequence number represents the first byte of data in the
current segment
•This sequence number is a 32-bit unsigned number that wraps
back around to 0 after reaching 232 - 1
•When a new connection is being established, the SYN flag is
turned on
•The sequence number field contains the initial sequence
number (ISN)
•SYN flag essentially tells the other end … “synchronize the
sequence number that you have for me…”

86

TCP Header – rest of the fields!

•A receiver acknowledges the receipt of datagrams (byte


numbered)
•The Acknowledgement Number in the header contains the
sequence number of the next byte of data that it is expecting to
receive

87

7
3/27/2013

TCP Header – rest of the fields!


• Header length/Offset: shows the size of TCP header where
the unit is 32 bits.
• The max size of TCP header can be (24-1)*32/8=60 bytes
• Without options the length is 20 bytes
• This indicates where the data begins
• ACK: When this flag is set, the acknowledgment field contains
the acknowledgement sequence number
• URG The urgent pointer is valid
• PSH The receiver should pass this data to the application as
soon as possible
• RST Reset the connection
• SYN Synchronize sequence numbers to initiate a connection
• FIN The sender is finished sending data.

88

TCP Header – rest of the fields!


• Window: Window size is used for flow control
• Each end advertises the size of next datagram that it can
accept
• With 16-bit field the value is limited to 65535
• Checksum: The checksum field is the 16-bit one's
complement of the one's complement sum of all relevant 16-
bit words.
Checksum is calculated on the TCP segment (Header +
Data) + a Pseudo-header and verified by receiver
• Urgent pointer: is a positive offset added to the sequence
number to show the end of data. TCP’s urgent mode enables a
sender to send emergency data to the other end
89

You might also like