Sei sulla pagina 1di 4

ccnahub.com http://www.ccnahub.

com/ip-fundamentals/understanding-multiplexing-tcp-and-udp-sockets/
Understanding Multiplexing TCP and UDP Sockets
Understanding Multiplexing TCP and UDP Sockets Article covers the following CCNA/ICND1 Exam Topics:
Under Operation of IP Data Networks:
1. Identify common applications and their impact on the network.
2. Predict the data flow between two hosts across a network.
Recommended Study Plan:
1. Download the ICND1v2 Exam Topics Sheet from Cisco Website.
2. Follow the Steps and the Articles under IP Networks Fundamentals by order.
3. Or start with TCP and UDP Protocols Article.
Average Time Required Studying this Article: 1 Hour
Multiplexing TCP and UDP Sockets
Multiplexing is used by both: TCP and UDP. When PC1 below requestes a webpage from a Hosting Server, PC1
HTTP protocol service will use port 80 as destination port to talk with the web-server service. By the way, Hosting
Servers run few services together and not only Web-server service, in fact, web-server is just one of the services that
all run together at a top of any Professional Hosting Server, hence, it hosts Multi TCP/IP Services. So, if PC1 using
FTP or Email application and pointing as well to the same Hosting Server, PC1s FTP application will use TCP port
type 21 as destination port to talk to FTP service, and PC1s Email application will use TCP port type 25 as
destination port to talk to the SMTP service where all of them run on the top of a Hosting Server. Meaning, when the
Hosting Server receives all 3 requests from the same PC1 using 3 different applications, Multiplexing Logic
(Regardless what is used TCP or UDP) manage multiple application requests without any problem at the Hosting
Server side.
From the Hosting Server point of view, PC1 is requesting data from the Hosting Server using 3 different Applications
(Web-Browser, FTP, and Email), meaning 3 different Services must respond to PC1 requests at the same time,
besides, PC1 using different type of IP Packets and all of them come from the same PC1s ISP Public IP Address.
The Hosting Server in this case needs the help of its Transport Layer to distribute PC1 Multi-requests properly to the
right services using Segmentation. Layer 3 at Hosting Server and after determining that all these packets hit their
final destination, IP Routing logic does not really care at what service or services the IP packets are heading (up to
the Transport layer), therefore, it is the Transport Layer job to distribute all these 3 different requests using
Segmentation based on port numbers. The Hosting Server Transport Layer Segments all the Upstream IP Packets
from layer 3 to different types of ports and services based on the destination Port type and Port Number used by
PC1. At PC1, Transport Layer Segments all the Downstream Data Requests again based on Port type and Port
Number used by PC1s Application and handle them to Layer 3 for IP Packeting.
At Transport Layer, TCP and UDP port types or protocols manage this situation by using different ports for sending
and receiving by using the port number filed in the TCP and UDP header respectively. When the Hosting server
responds, each service such Web, Mail, FTP, and so on that is Hosted on the Hosting Server uses TCP or UDP ports
allows Layer 4 to segment precisely using different destination port numbers. So when PC1 receives the information,
it knows or PC1s Transport Layer will know how to distribute the received packets from the Hosting Server to the
right Client/Application such Mail, FTP, Web, or Voice Application.
TCP and UDP Sockets
Multiplexing means Multiprocessing and it heavily depends on sockets. From PC1 perspective, when we say socket
which is the combination of IP address and a Port Number 172.16.10.20:25, we are referring to three things:
1. The Private or Public IP address that is being used by PC1 to request data, its Mail Data since port 25 is being
used 172.16.10.20:25
2. A hidden Transport Protocol between the IP and the Port number TCP is used in this case since mail clients
needs guarantee delivery.
3. Port number 25 uses TCP port type and is used by PC1 to communicate with the Mail service which is located at
the Hosting Server.
Prom PC1 perspective: How Sockets can serve PC1 in terms of requesting and receiving data from the
Hosting Server?
As shown in the figure above, PC1 can request from the Hosting-Server: mail, web, ftp, and tftp data at the same
time, by opening Mail client, Web Browser, FTP, and TFTP all at the same time. It can even open instances of each
application if needed; lets say 10 web pages of the same exact page from the same hosting-server. The reason why
PC1 can open multiple instances of the same application or multiple applications at the same time from the same
Hosting-Server is due to Socket Technique. PC1 randomly assign itself dynamic port numbers to be used by the
Transport Layer when needed as source port numbers, PC1 and any client allowed to use ports starting from 1024
and up. From 1023 port and below are reserved for known services used by the Hosting Server to answer PC1, PC2,
or any PC requests.
From Hosting-Server Perspective: How Sockets can help the Hosting-Server answering requests to deliver
data to the right PC?
Mail, FTP, TFTP, and Web services all running at the Hosting Server and ready to respond to any request from any
PC in a LAN Network or the Internet without any conflict. How the Transport Layer at the Hosting Server handles all
these data requests smoothly? Well, if clients obey the rules and use only Registered and Dynamic Ports, then the
Hosting Servers services will use Reserved Ports to serve requests from any client.
What do you mean by any client? Each clients request arrives at the Hosting Server has a unique Finger Print
which include:
1. The IP address of that client requesting the data.
2. TCP or UDP port number.
This combination is a perfect Finger Print to create a socket, and from the Hosting Server perspective it is similar to a
Phone number with a Voice mail extension.
Note: Since Apache and IIS are Web Services, Hosting Servers cannot have two services such Apache and IIS
running at the same time and assigned the same port number 80 or 443 to serve clients requests. Each registered
port at the server side must be associated with Only One Service.
Keep in mind that same thing applies at the router or firewall level, e.g. I cant open port 80 or 443 at the router or
firewall and have it associated or point to more than one private IP address, unless I have more than one Public IP
address. If you want to run multiple instances of web-servers and you have More than One Public IP address, use
virtualization such vSphere or Hyper-V to run more than one instance of Apache or IIS and have each one of them
associated with its own Public IP address. Routers and firewall rules and the distribution from these devices to
different servers or services are beyond of this Article.
Next: Application Layer Protocols and Services
Go to top
About Imad Daou
He is the founder of CCNA HUB, a CCNA Training HUB to help CCNA students get certified. Imad has more than 10
years of IT experience as Field Service and Consulting Engineer. A+, Network+, Server+, Security+, Storage+, HP,
Dell, and IBM Hardware Certified. He's a Professional SMB IT Consultant.
Facebook Twitter Linkedin Google
Copyright secured by Digiprove 2013 Imad DaouSome Rights Reserved
Original content here is published under these license terms: X
License
Type:
Attribution, Share Alike
License
Summary:
You may copy this content, create derivative work from it, and re-publish it, provided you include an
overt attribution to the author(s) and the re-publication must itself be under the terms of this license or
similar.
License
URL:
http://creativecommons.org/licenses/by-sa/3.0/

Potrebbero piacerti anche