This document discusses the TCP/IP and UDP protocols. It begins with an introduction comparing the TCP/IP model to the OSI model. The TCP/IP model has four layers compared to seven in the OSI model. It then describes the two main host-to-host layer protocols in TCP/IP - TCP and UDP. TCP is connection-oriented and provides reliable, ordered delivery. It uses segments with a header containing fields like sequence numbers. UDP is connectionless and provides fast but unreliable delivery. It uses simpler segments with fewer header fields. The document concludes by explaining the end-to-end delivery process for packets using these protocols as they are transmitted between hosts via routers.
3. INTRODUCTION
TCP/IP and the OSI Model Comparison
THE TCP/IP AND OSI MODEL
• TCP/IP PROTOCOL SUITE
Host-to-Host Layer Protocols
Transmission Control Protocol (TCP)
• TCP SEGMENT FORMAT
User Datagram Protocol (UDP)
• UDP SEGMENT FORMAT
Which One Should You Use?
CONTENT LIST
4. • The TCP/IP suite was created by the U.S. Department of Defense
• To ensure that communications could survive any conditions and that
data integrity wouldn't be compromised under malicious attacks.
• The Open Systems Interconnection Basic Reference Model (OSI
Model) is an abstract description for network protocol design,
developed as an effort to standardize networking.
Introduction
5. • Let's Start by Comparing TCP/IP and the OSI Models.
• The TCP/IP model is basically a shorter version of the OSI
model.
• It consists of four instead of seven layers.
• Despite their architectural differences, both models have
interchangeable transport and network layers and their
operation is based upon packet-switched technology.
TCP/IP and the OSI Model Comparison
7. Application Layer:
• Deals with representation,
• Encoding
• Dialog control issues.
Host-to-Host:
• Its equivalent Transport protocol in the OSI model.
• Its responsibilities include application data segmentation,
• Transmission reliability, flow and error control.
Internet:
• Their purpose is to route packets to their destination independent of the path
taken.
Network Access:
• The network access layer deals with all the physical issues concerning
• Data termination on network media.
• It includes all the concepts of the data link and physical layers of the OSI
model for both LAN and WAN media.
10. • TCP is connection-oriented in the sense that prior to transmission end points
need to establish a connection first.
• TCP protocol data units are called segments.
• The sending and receiving TCP entities exchange data in the form of segments,
which consist of a fixed 20-byte(160 bits) header followed by a variable size
data field.
• TCP is responsible for breaking down a stream of bytes into segments and
reconnecting them at the other end,
• Retransmitting whatever might be lost and also organizing the segments in the
correct order.
• The segment size is restricted by the maximum transfer unit (MTU) of the
underlying link layer technology (MTU is generally 1500 bytes which is the
maximum payload size of the Ethernet).
Transmission Control Protocol (TCP)
12. Source Port & Destination Port:
• Fields together identify the two local end points of the particular connection.
• A port plus its hosts' IP address forms a unique end point.
• Ports are used to communicate with the upper layer and distinguish different application sessions on the host.
Sequence Number & Acknowledgment Number
• Fields specify bytes in the byte stream.
• The sequence number is used for segment differentiation
• Useful for reordering or retransmitting lost segments.
• The Acknowledgment number is set to the next segment expected.
Data offset or TCP header length
• Indicates how many 4-byte words are contained in the TCP header.
Window field
• Indicates how many bytes can be transmitted before an acknowledgment is received.
The Checksum
• Field is used to provide extra reliability and security to the TCP segment.
The actual user data
• are included after the end of the header.
13. • UDP protocol consists of fewer fields compared to TCP.
• The reason for that is because certain data types do not require reliable
delivery and extra overhead.
• Real-time traffic for example, needs to be transported in an efficient way
without error correction and retransmission mechanisms.
• UDP is considered to be a connectionless protocol.
• It leaves reliability to be handled by the application layer.
• All it cares about is fast transmission.
• The UDP segment format is presented in the next slide.
User Datagram Protocol (UDP)
15. • The IP routing processes for all nodes involved in the delivery of
an IP packet include the sending host, the intermediate routers,
and the destination host.
END TO END DELIVERY
16. • When a host sends a packet, the packet is transmitted from an upper layer protocol
(TCP, UDP, or ICMP) to IP, and then IP on the sending host does the following:
• Sets the Time-to-Live (TTL) value to either a default or application-specified value.
• Checks its routing table for the best route to the destination IP address.
If no route is found, IP sends a routing error message to the upper layer protocol
(TCP, UDP, or ICMP).
• Determines the next-hop IP address and the interface, based on the most specific
matching route.
• Sends the packet, the next-hop IP address, and the next-hop interface to Address
Resolution Protocol (ARP), and then ARP resolves the next-hop IP address to its
media access control (MAC) address and forwards the packet.
IP on the Sending Host
17. When a packet is received at a router, the packet is passed to IP, and IP on the router does the following:
• Verifies the IP header checksum.
If the IP header checksum fails, the IP packet is discarded without notification to the user. This is known as a silent discard.
• Verifies whether the destination IP address in the IP packet corresponds to an IP address assigned to a router interface.
If so, the router processes the IP packet as the destination host If the destination IP address is not the router, IP decrements the
Time-to-Live (TTL).
If the TTL is 0, the router discards the packet and sends an ICMP Time Expired–TTL Expired in Transit message to the sender.
• If the TTL is 1 or greater, IP updates the TTL field and calculates a new IP header checksum.
• IP checks its routing table for the best route to the destination IP address in the IP packet.
If no route is found, the router discards the packet and sends an ICMP Destination Unreachable–Host Unreachable message to
the sender.
• Based on the best route found, IP determines the next-hop IP address and interface.
• IP sends the packet, the next-hop IP address, and the interface to ARP, and then ARP forwards the packet to the appropriate
MAC address.
• This entire process is repeated at each router in the path between the source and destination host.
IP on the Router
18. When a packet is received at the destination host, it is passed up to IP, and IP on the destination host does
the following:
• Verifies the IP header checksum.
If the IP header checksum fails, the IP packet is silently discarded.
• Verifies that the destination IP address in the IP packet corresponds to an IP address assigned to the
host.
If the destination IP address is not assigned to the host, the IP packet is silently discarded.
• Passes the IP packet without the IP header to the appropriate upper-level protocol, based on the IP
protocol field.
If the protocol does not exist, ICMP sends a Destination Unreachable–Protocol Unreachable message
back to the sender.
• For TCP and UDP packets, IP checks the destination port and processes the TCP segment or UDP
header.
If no application exists for the UDP port number, ICMP sends a Destination Unreachable–Port
Unreachable message back to the sender. If no application exists for the TCP port number, TCP sends a
Connection Reset segment back to the sender.
IP on the Destination Host