You are on page 1of 73

EL- 303

Computer Communication Networks


SPRING 2020
TABASSUM WAHEED
SPRING 2021
TCPIP
EXAMPLE
WWW- Sender, Receiver
NETWORK IDENTIFIERS
• IP ADDRESS- LOGICAL ADDRESS
• MEDIA ACCESS CONTROL ADDRESS –PHYSICAL ADDRESS
• LOGICAL PORT NUMBER (0-65,536)
PORT
PORT
PORT
PORT
HACKING TOOL
SOCKET
SOCKET
ISPs
Connectivity
COMPARISON
LAYERS
The TCP/IP application layer contains three layers from the OSI model:
• Application layer
• Presentation layer
• Session layer 
• The working of the application layer in the TCP/IP is a combination of
these three layers from the OSI model.
• The network interface layer in TCP/IP is a combination of two layers
form the OSI model (data link and physical layer
IP
• The Internet Protocol (IP) is a protocol, or set of rules, for
routing and addressing packets of data so that they can travel
across networks and arrive at the correct destination.

• ... IP information is attached to each packet, and this


information helps routers to send packets to the right place
IP Packet
Packet loss
ICMP (Internet Control Message Protocol)

• This acts as a tool for solving problems. The ICMP reports any
communication errors between hosts. ICMP messages can help to
diagnose a problem. For example, if the router or host is overloaded,
ICMP can send a message to slow down the transfer rate.
• ICMP is used in the ping program, which allows the diagnosis of network
connections. Ping lets you check if there is a connection between the
hosts. It also allows you to measure the number of packets lost and delays
in their transmission.
• In the terminal, type ping www.scalac.io. After ping, you need to provide
the host. You can choose any website. I’m going to check my connection
with the scalac site. To exit ping, use CTRL + C.
Gopher
ICMP
• Ping sends an ICMP packet to the
host provided. In my case, I sent 17
packets and received back 17
packets. In this short connection, I
didn’t lose any packets. The
program also counts the time gap
between sending and receiving
packets. In the end, the program
summarizes the connection and
shows us the minimal/ average /
maximum time gap between
sending and receiving packets.
TCP
• TCP/IP helps you to determine how a specific computer should be
connected to the internet and how you can transmit data between them.
It helps you to create a virtual network when multiple computer
networks are connected.
• TCP/IP stands for Transmission Control Protocol/ Internet Protocol. It
is specifically designed as a model to offer highly reliable and end-to-
end byte stream over an unreliable internetwork.
TCP 3-WAY HANDSHAKE
3-WAY HAND SHAKE
• TCP is a highly reliable and connection-oriented protocol. It applies
the 3-way handshake principle. Before it sends any data, it will first
establish a connection.
3-WAY HAND SHAKE
• This rule consists of three steps, made to establish a connection.
1.SYN – The device sends a message to the server, “I want to connect with you.”
2.SYN / ACK – When the server receives the message, it will reply that it is ready for
communication.
3.ACK – The device sends confirmation of receiving the response from the server and that it is
ready for communication.
• The high reliability of TCP is due to the device, making sure that the data sent has been received
by the server. Then the server makes sure that the data sent to you have been collected by you. If
the server sends 10 data packets, and for some reason, you do not receive one of them, and you
do not confirm the receipt, this server will try to send the lost package again. 
• TCP also provides data delivery in order. Each sent packet is numbered. Although packets may
still arrive out of order, TCP will arrange them in order before sending them to the application.
features of TCP
• Here, are some important features of TCP
• Delivery Acknowledgements
• Re transmission
• Delays transmission when the network is congested
• Easy Error detection
What is UDP?

• UDP is a Datagram oriented protocol. It is used for broadcast and


multicast type of network transmission.
• The full form of UDP is User Datagram Protocol (A datagram is a
transfer unit associated with a packet-switched network.)
• The UDP protocol works almost similar to TCP, but it throws all the
error-checking stuff out, all the back-and-forth communication and
deliverability.
How UDP work?

• UDP uses a simple transmission method without implied hand-shaking


dialogues for ordering, reliability, or data integrity.
• UDP also assumes that error checking and correction is not important
or performed in the application, to avoid the overhead of such
processing at the network interface level.
• It is also compatible with packet broadcasts and multicasting.
features of UDP
Here, are some important feature of UDP:
• Supports bandwidth-intensive applications that tolerate packet loss
• Less delay
• It sends the bulk quantity of packets.
• Possibility of the Data loss
• Allows small transaction ( DNS lookup)
UDP (User Datagram Protocol)

• UDP sends data and doesn’t care if the device has received it or not. It
also doesn’t care if some packets are lost. But the significant
advantage of the User Datagram Protocol is that the packet sizes are
smaller than TCP (about 60% lighter). 
Application of UDP

• UDP method is largely used by time-sensitive applications as well as


by servers that answer small queries from a larger client base.
• UDP is compatible with packet broadcasts for sending all over the
network and for multicasting sending.
• It is also used in Domain Name System, Voice over IP, and online
games.
comparison
• UDP is an economical version of TCP. 
• Connectionless and unreliable.
• No data retransmission
• No data delivery acknowledgment
• Data can arrive out of order
• You may ask the question, then why use UDP? It’s such an unreliable
protocol!
• In some cases, UDP is better because TCP has significant overheads (data
retransmission, delivery acknowledgment, etc.) UDP is often used to transmit
data in real-time: video streaming or audio such as Skype calls.
TCP, UDP
TCP Advantages:

1.Retransmission:
• When a sender doesnt get an acknowlegement after a certain period of time, it
will assume that the packet got lost on its way. So, it will send it again-.
• 2. In-order delivery
• Because segments are ordered in TCP, it implements in-order delivery.
• Although packets may come out of order, TCP rearranges them before sending
them to application.
• 3. Congestion Control
• Delays transmission when the network is congested
• 4. Error Detection
TCP Disadvantages
• Bigger header
• Data doesnt always sent out immediately
• side effect of congestion control
• Hence real time conversation will not feel real time as you wanted to
be
• As you can see, congestion control can be a nuisance
• Bigger overhead
• Retransmission of packets, acknowledgement of packets
UDP advantages:

• small packet sizes than TCP by about 60%


• UDP header 20 bytes
• TCP header 80 bytes
• Connectionless: No connection to create and maintain
• You dont have to create connection first before sending out data
• You have more control of when data is being sent out
UDP Disadvantages:

• Data corruption is a common occurance on the Internet, UDP has a


primitive form of error detection.
• No compensation for lost packets
• Packets can arrive out of order
• No congestion control
• Conclusion: UDP may be light weight, but not that reliable.
DNS
• DNS (Domain Name Services)
– Changes the domain name to an IP
address. The domain name is used
because it’s human-friendly. It’s easier to
remember a domain name
(www.google.com) than an IP address
(172.217.16.4). When you type any
website address into a browser, then the
browser sends a request to the DNS for
the IP address of that domain.
example
Hitech
Japan
Website……..server ………..hosted
10.0.0.1

Http://10.0.0.1..........friendly names

www.hitech.edu.jp
URL
example
http://www.uit.edu.pk
http://mail.uit.edu/files
Domain hierarchy
example
http://www.uit.edu.pk/EL303/MID.docx
DNS
• If you type into a browser IP 172.217.16.4, then you should see the
Google page because this is Google’s IP address. I can get it directly
by requesting the DNS in the terminal. Type in terminal: nslookup
www.google.com. 
How DNS works?
NTP
• NTP (Network Time Protocol) – This is an uncomplicated and
straightforward protocol. It is used for automatic time synchronization
in devices connected to a network. Imagine now manually
synchronizing time for 10 or 50 devices.
SNMP, SSH
• SNMP (Simple Network Management Protocol) – This is used for
monitoring, management of updates, and diagnostics of networks and
network devices.
• SSH (Secure Shell) – This allows you to remotely log in to the
terminal in network devices and administer them (e.,g. router, firewall,
a remote server). SSH is secure because communication is encrypted.
SSH uses the TCP protocol.
FTP
• FTP (File Transfer Protocol) –  The purpose of this protocol is to
display a list of files/folders, adding, deleting, or downloading them
from the server. A good example is sending website files to a server.
To do this, you need to use an FTP client with which you can
authenticate yourself and get access to the FTP server. A popular FTP
client is FileZilla. FTP uses TCP. 
SMTP
• SMTP (Simple Mail Transfer Protocol) and IMAP (Internet Access
Message Protocol) are two protocols used in sending and receiving
emails. SMTP’s task is to send email messages from a client to an
email server or between email servers. IMAP is used to manage and
retrieve email messages from an email server.
E-MAIL
Browser protocols

• HTTP/HTTPS –. HTTPS extends HTTP functionality with data encryption


protocols.
• HTTP is a communication protocol. It defines mechanism for
communication between browser and the web server. It is also called
request and response protocol because the communication between
browser and server takes place in request and response pairs.
HTTP Request
• HTTP request comprises of lines which contains:
• Request line
• Header Fields
• Message body
HTTP
VoIP protocols (Voice over IP)

• SIP (Session Initiation Protocol) – This performs an administrative


function (using TCP). It is used only to set and close an audio or video
connection.
• RTP (Real-Time Transport Protocol) – This is used to transfer data
during audio or video calls (using UDP).
• For example, let’s say you want to call someone on Skype. SIP will be
used to establish the connection. When the connection is established,
the RTP springs into action and transmits the data. When you end the
conversation, SIP will close the connection.
ARP
• The address resolution protocol (arp) is a protocol used by
the Internet Protocol (IP) [RFC826], specifically IPv4, to map IP
network addresses to the hardware addresses used by a data
link protocol. The protocol operates below the network layer
as a part of the interface between the OSI network and OSI link
layer.
ARP (Address Resolution Protocol)

• Used to identify the MAC address. If the device knows the IP address
of the target device, then ARP sends a request to all of the devices in
the LAN to search for the MAC address of the device with the given
IP. Then the device with that IP sends an ARP response with its MAC
address. 
• This information will be saved in the ARP table. In windows or
macOS, open terminal and type arp -a. Then you should see the ARP
table.
ARP
Sending a packet from Argon to Neon

70
Sending a packet from Argon to Neon 128.143.71.21 is not on my local network.
Therefore, I need to send the packet to my
128.143.71.21
default is on
gateway with my local
address network.
128.143.137.1
DNS:
DNS:
ARP:What
The is
What IPisthe
address
theIPMAC
address
of Therefore, I can send the packet directly.
“neon.tcpip-lab.edu”
address
ARP: TheofMAC is of
128.143.137.1?
address
of128.143.71.21
“neon.tcpip-lab.edu”?
128.143.137.1 is 00:e0:f9:23:a8:20
ARP: What is the MAC
ARP: TheofMAC
address address of
128.143.71.21?
128.143.137.1 is 00:20:af:03:98:28

frame frame

71
Layers in the Example

72
Layers in the Example
Send HTTP Request
to neon

Establish a connection to 128.143.71.21 at


port 80Open TCP connection to
128.143.71.21 port 80
IP datagram is a TCP
segment for port 80
Send a datagram (which Send IP data-gram
contains to
a connection
Send IP datagram to
128.143.71.21
request) to 128.143.71.21
128.143.71.21
Frame is an IP Frame is an IP
datagram Send the datagram to 128.143.137.1datagram
Send the datagram
to 128.143.7.21

Send Ethernet frame Send Ethernet frame


to 00:e0:f9:23:a8:20 to 00:20:af:03:98:28

73

You might also like