UDP/TCP/IP Protocol Architecture

advertisement
UDP/TCP/IP Protocol Architecture








Overall Picture of the TCP/UDP/IP
protocols
Protocol Headers
Overview of TCP
State Transition Diagram
Connection end-points
Buffering
Overview of UPD
Standard Services and Protocol Usage
 Overall Picture of the TCP/UDP/IP
protocols:
 Protocol Headers:
IP , UDP , TCP & Encapsulation
Encapsulation
 Overview of TCP:

Reliability: Requires ACK & Retransmission.
It dynamically computes RTT for estimating how
long to wait for ACKs:
millisecs for LANs, seconds WANs.

Sequence Numbers: To detect packet
loss, reordering and duplicate removal.

Flow Control: Tell peer exactly how many
bytes it is willing to accept
(receiver buffer called window).

Full Duplex: send and recv data in both
directions.

Connection Establishment: 3-way
handshake
 Options: Each synch segment contains:


MSS Option: maximum segment size (the
maximum amount of data it is willing to accept
in each TCP segment).
Window Scale Option: maximum window is
65,535 bytes,
it can be scaled (left-shifted) by 0-14 bits
providing a maximum of 65,535x2**14 byte
(one gigabyte).
 Connection Termination: Requires 4
segments
 State Transition Diagram:



Watching the Packets: Packet exchange
for TCP Connection
Time-Wait state: (around 2 minutes)
 To allow old duplicate segments to expire in the
Network.
 The end that performs the active close is the one
that goes through TIME-WAIT state in order to
ACK the final FIN.
 Connection end-points:

Port numbers: 16 bit integers (65,535).



Servers use well know ports, 0-1023 are
privileged.
Clients use ephemeral (short-lived) ports.
Socket Pair:
localPort,

four_tuple
< localIP,
foriegnIP, foriegnPort >
Concurrent servers: listen, connect and
accept ,
2nd
Client:
 Buffering:
Buffer Sizes and Limitations:
 MTU: Maximum Transmission Unit (Ethernet
1500 bytes).
 Path MTU: smallest MTU in a path.
 If IP datagram exceeds MTU it is fragmented
& reassembled at the final destination.
 If DF (Do't fragment) bit is set, ICMP is
returned
(this is the basis for the path MTU discovery).
 IP with 576 bytes will not be fragmented.
 TCP MSS is = (interface MTU - header
lengths).
TCP Output:
Return from write means: reuse application
buffer,
but data may still be in the socket buffer of
sender and it does not mean the peer got it.
 Overview of UPD:
 Simple.
 Connectionless.
 Unreliable.
UDP Output:
No buffering, packets are copied directly
into the datalink output queue.
 Standard Services and Protocol
Usage:
Standard Internet Services:
Sample (More details at: /etc/services)
Protocol Usage by Common Internet
Applications:
Examples
Download