Title: TCP/IP Application Model
1TCP/IP Application Model
Application
TCP
UDP
IP
Network Protocols
Protocol Stack
2UDP Connectionless Transport Protocol
UDP extends the host-host delivery service of the
underlying network into a process-process
communication service.
- Provides a multiplexing/demultiplexing service to
allow multiple processes on each host to share
the network. - Ensures correctness of the message by use of a
checksum. - Adds no other functionality beyond best effort
delivery service of the underlying network.
3UDP Header Format
Destination Port
Source Port
Checksum
Length
Data
4Determining the UDP Checksum
PseudoHeader
UDP Length
Protocol
Pad 00000000
Source IP Address
Destination IP Address
Source Port
Destination Port
Length
Checksum
Data
UDP Datagram
5Ports
Queues
Packets demultiplexed
Packets arrive
6TCP a Reliable Byte Stream Protocol
TCP (Transport Control Protocol) is a connection
oriented protocol that guarantees the reliable,
in-order delivery of a stream of bytes.
- TCP is full-duplex (it supports a pair of byte
streams flowing in opposite directions.) - It provides for flow control which allows a
receiver to limit the rate at which a sender can
transmit. - It implements a congestion control mechanism
which throttles the sender from overloading the
network. - Like UDP, it provides for multiplexing/demultiplex
ing of packets
7TCP Packet Format
For reliable, in order delivery
For process demultiplexing
For flow control
Other fields
Destination Port
Source Port
Sequence Number (byte count)
Acknowledgement
Advertised Window
Flags
0
HdrLen
Checksum
Urgent Pointer
Options (variable length)
Data
8The Three-way Handshake
Initiator
Receiver
ScrPort21
DstPort13
ScrPort13
DstPort21
ScrPort13
DestPort21
SEQ 1234
SEQ 6789
SEQ 1235
ACK xxxx
ACK 1235
ACK 6790
5
SYN
0
1024
5
0
ACK
1024
5
0
SA
2048
NIL
Checksum
NIL
Checksum
Checksum
NIL
Receiver prepares acceptance
Initiator sends request to Receiver
9Demonstration of TCP Byte Transfer
TCP Demonstration
This applet demonstrates an initial 3-way
handshake to establish a TCP connection, then
illustrates the use of the advertised window to
regulate the exchange of bytes between the two
hosts.
Current limitations Buttons are not installed,
the processing time is taken to be about 25
seconds for easier viewing.
10Host As State
A Sends SYN
Connected
TCP Connection Closed
A Initiates Close
LISTEN
SYN_SENT
SYN_RCVD
SYN_RCVD
SYN_SENT
ESTABLISHED
ESTABLISHED
CLOSE_WAIT
CLOSE_WAIT
FIN_WAIT_1
FIN_WAIT_1
LAST_ACK
LAST_ACK
FIN_WAIT_2
FIN_WAIT_2
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
11Port An abstraction for locating services
Each service is associated with a given port
number on a given machine. When you ask for a
particular port, you are requesting the service
associated with that port number.
There are 2 16 available numbers, but the
numbers 1 1024 are reserved for well-known
services and should not be used for user
initiated services.
Port number 7 is used for the echo server
and Port number 13 is used for the time and date
service
It is up to the client to know which port number
the desired service is running on.
12TBA