2. Learning Outcome
• At the end of this lecture, students will be
able to,
– Enumerate the layers of the TCP/IP.
– Explain the fields of TCP Header.
2
3. • What are the layers associated with OSI
reference model?
3
Recall
4. Comparison between OSI and
TCP/IP
4
Application
ApplicationPresentation
Transport
Session
Internet
Transport
Data Link
Physical
Network
Data Link
Physical
Several Application
Protocols
Several Transport
Protocols
Internet Protocol and
some helping Protocols
Underlying LAN
and WAN
technology
TCP/IP Protocol
Suite
OSI Model
Fig. 1. Layers of OSI and TCP/IP
5. Comparison between OSI and
TCP/IP
5
OSI (Open System Interconnection)
TCP/IP (Transmission Control Protocol /
Internet Protocol)
Has 7 Layers Has 4 Layers
Protocol Independent Standard Based on standard protocols
Separate Presentation and Session Layer No separate Presentation and Session Layer
Transport Layer connection oriented
Both connection oriented and connectionless
Transport Layer
Both connection oriented and connectionless
services by Network Layer
Connectionless service provided by Network
Layer
Transport Layer guarantees the delivery of
packets
Transport Layer does not guarantees the
delivery of packets
Table. 1. Comparison between OSI and TCP/IP
6. Packet Encapsulation
6
Fig. 2. Packet Encapsulation
Application
Transport
Internet
Data Link
Physical
Data
DataTCP/UDP
Header
DataTCP/UDP
Header
IP
Header
DataTCP/UDP
Header
IP
Header
Frame
Header
Frame
Trailer
Application Data
TCP Segment or UDP Packet
IP Datagram
Network Frame
7. TCP Header
7
Source Port Destination Port
Sequence Number
Acknowledgement Number
TCP
Header
Length
U
R
G
A
C
K
P
S
H
R
S
T
S
Y
N
F
I
N
Window Size
Checksum Urgent Pointer
Options (0 or more 32-bit words)
Data (optional)
Fig. 3. TCP Header Format
8. TCP Header
8
Field Purpose
• Source Port Identify the local end points
• Destination Port Identify the local end points
• Sequence Number Sequence number of first octet in the segment
• Acknowledgment Sequence number of the next expected octet (if
ACK flag set)
• TCP Header Length Length of TCP header in 4 octet units
• Flags TCP flags: URG, ACK , PSH , RST, SYN, FIN
• Window size Number of octets from ACK that sender will accept
• Checksum Checksum of IP pseudo-header + TCP header + data
• Urgent Pointer Pointer to end of “urgent data”
• Options Special TCP options such as MSS and Window
Scale