Académique Documents
Professionnel Documents
Culture Documents
1
Recap
Features of TCP/IP
2
Objectives
3
Ports and Sockets
A Client machine is capable of browsing multiple web
pages originated from different web servers
simultaneously
Ports and Sockets help to identify the process running on
the host machine uniquely
Every process is identified by a 16-bit port number
Socket is the program that is associated with every
process
When a web page is opened, automatically a socket
program is initialized to receive/send packets to the
process
A port number is also created to identify the process
uniquely
4
Ports and Sockets
5
Why need Ports & Sockets ?
Client machines run multiple processes while browsing
multiple web pages at the same time
Example : Computer A communicate Computer C
using TELNET
Computer A communicate Computer B
using FTP
To communicate over TCP, the source process and
destination process establish a connection to one another
6
Why need Ports & Sockets ? Contd
Data transfer from source to destination host needs IP
Address and Physical Addresses of Connection End
Points
7
What is a Port ?
One of the circuit connection points on a front end
processor or local intelligent controller
P
TCP SRC
o
Dest.
r Host
Host t
8
Ports
Process 1 Process 2 Process 3 Process 4
Data
9
Port Number
Port is represented by a positive (16-bit ) integer value
between 0 and 65,535
10
Port Number
11
Port Number
Registered Ports
Dynamic Ports
13
Socket Address
Example
I P Address 200.23.56.8 69 <-- Port Number
14
Socket Address Contd
Transport Layer Protocol needs a pair of Socket
addresses
Client Socket Address
Uniquely defines the Client Process
Server Socket Address
Uniquely defines Server Process
15
Socket Communication
A server (program) runs on a specific computer and has a
socket that is bound to a specific port. The server waits and
listens to the socket for a client to make a connection
request
FIG .1
16
Socket Communication Contd.
It needs a new socket so that it can continue to listen to the
original socket for connection requests while tending to the
needs of the connected client
FIG .2
17
Socket Communication contd.
18
Types of Sockets
Active Socket
Connected to a remote active socket via an open data
connection
Closing the connection, destroys the active sockets at
each point
Passive Socket
Connected, but awaits an incoming connection, which
will spawn a new active socket
Each port contains
Single Passive Socket - awaiting incoming connections
Multiple Active Sockets - each corresponds to an open
connection on the port
19
Summary
In this topic , you have learnt about
20
Summary
21
Quiz
A. Ports
B. Sockets
C. Packets
22
Quiz
2. A Port Number ranges from ____________
A. 1024 to 65536
B. 0 to 65535
C. 0 to 1024
D. 4096 to 65535
23
Quiz
24
Quiz
4. Sockets provide an interface for programming
networks at the ____________ layer
A. Application
B. Network
C. Physical
D. Transport
25
Frequently Asked Questions
26