Lecture 05
Lecture 05
Lecture 05
1
Introduction
TCP UDP
IP
2
Role of TCP
3
Role of UDP
Port Numbers
4
Port Numbers (contd.)
Port 30 Process 3
A host on the
Internet
5
Port Numbers (contd.)
User User
Process Process
Port Address
TCP UDP (16 bits)
IP Internet Address
(32 bits)
Physical Address
Ethernet Layer
(48 bits)
• Client-server scenario
¾By knowing the 32-bit IP address of the
server host, a client host can connect to
the server.
¾To identify a particular process running
on the server host, the client must also
know the corresponding port number.
• Well-known port numbers
¾Predefined, and publicly known.
¾FTP uses port 21, SMTP uses port 25.
6
Port Numbers (contd.)
/etc/services
echo 7/tcp
echo 7/udp
systat 11/tcp users #Active users
systat 11/tcp users #Active users
daytime 13/tcp
daytime 13/udp
ftp-data 20/tcp #FTP, data
ftp 21/tcp #FTP. control
telnet 23/tcp
smtp 25/tcp mail
time 37/tcp timserver
7
Ephemeral Port Numbers
• A typical scenario:
¾A client process sends a message to a
server process located on some host at
port 1534.
¾How will the server know where to
respond?
Client process requests an unused port number
from the TCP/UDP module on its local host.
These are temporary port numbers, called
ephemeral port numbers.
Send along with the TCP or UDP header.
8
Connection Establishment
Association
9
TCP Encapsulation
Sequence Number
Acknowledgement Number
HLEN Reserved Flags Window
Checksum Urgent Pointer
Options
DATA
10
TCP Header Fields
11
TCP Header Fields
• Flags (6 bits)
¾There are six flags.
URG is set to 1 if the urgent pointer is in
use.
A connection request is sent by making
SYN=1 and ACK=0.
A connection is confirmed by sending
SYN=1 and ACK=1.
When the sender has no more data, FIN=1 is
sent to release the connection.
12
TCP Header Fields (contd.)
0 16 31
Source Port Destination Port
Message Length Checksum
DATA
13
UDP Header Fields
14
SOLUTIONS TO QUIZ
QUESTIONS ON
LECTURE 4
15
Quiz Solutions on Lecture 4
16
Quiz Solutions on Lecture 4
17
Quiz Solutions on Lecture 4
18
Quiz Solutions on Lecture 4
19
Quiz Solutions on Lecture 4
196.143.48.129
20
Quiz Solutions on Lecture 4
21
QUIZ QUESTIONS ON
LECTURE 5
22
Quiz Questions on Lecture 5
23
Quiz Questions on Lecture 5
24