CCNUnit 1
CCNUnit 1
3
COMPUTER COMMUNICATION NETWORKS
INTERNET -
VISUALIZATION
▪ Internet is viewed as a
graphical network that provides
services to distributed
applications.
▪ End systems are referred to as
hosts because they host (that
is, run) application programs.
▪ End systems are at the edge of
the network.
▪ Hosts are further divided into
two categories: clients and
4
servers
COMPUTER COMMUNICATION NETWORKS
INTERNET -
VISUALIZATION
5
Introduction
• Notable inventions and inventors
• World wide web: Tim Berners Lee, MIT laboratory
1989-90
• Email: Ray Tomlinson, BBN 1972
• DNS: Paul Mockapetris, USC 1982
• RFC: Stephen Crocker, UCLA 1969
• Packet switching: Leonard Kleinrock, UCLA 1961
• TCP/IP: Bob Khan and Vincent Cerf, DARPA and SRI
1972-73
• Ethernet: Bob Metcalfe, Xerox PARC 1973
6
Introduction
• Who owns/controls the internet?
• ISP (Internet Service Provider) is a business entity or
company which provides internet access to the
end-systems in return for a subscription fee
• The place where end-systems connect to an ISP is
referred to as point-of-presence (PoP).
• The number of PoPs (typically in 1000s) held by an
ISP tells about its outreach in the internet.
• PoP consists of routers, link layer switches, MPLS and
communication links.
• ISP examples: Telecom operators, Cable TV
operators, Fiber (optic) operators
7
COMPUTER COMMUNICATION NETWORKS
Application Layer
ISP Architecture
Types of ISPs
4
1
0
COMPUTER COMMUNICATION NETWORKS
Network Core
Global Transit
ISP
Customer
Examples of Tier 1 ISPs: AT&T, Sprint, Verizon etc. in the US. Bharti, Reliance, Tata and VSNL are Tier-1 ISPs in India
Examples of Regional ISPs: BSNL, Airtel, Vodafone, Reliance communications, etc.
Organization of Network Core: ISP
hierarchy
4
COMPUTER COMMUNICATION NETWORKS
Network Core
Multihoming :
• Any ISP (except for Tier-1 ISPs) may choose to multi-home, that is,
to connect to two or more provider ISPs.
• For example, an access ISP may multi-home with two
regional
ISPs, or it may multi-home with two regional ISPs and also with a
tier-1 ISP.
• Similarly, a regional ISP may multi-home with multiple tier-1 ISPs.
12
Introduction
• PoP
13
Introduction
14
COMPUTER COMMUNICATION NETWORKS
Network Core
Peering:
▪ ISPs at the same level of the hierarchy can peer, that is,
they can
directly connect their networks together so that all the traffic between
them passes over the direct connection rather than via
upstream
intermediaries.
End systems, packet switches, and other pieces of the Internet run
protocols that control the sending and receiving of information within the
Internet. The two major protocols are as follows:
The IP protocol specifies the format of the packets that are sent and
received among routers and end systems.
4
1
7
Introduction
• ISP hierarchy (contd.)
18
Introduction
• Revenue generation is as follows:
• End users pay access ISPs
• Access ISPs pay to regional ISPs
• Regional ISPs pay to Tier 1 ISPs
• Tier 1 ISPs may have several bilateral agreements to share resources such as
bandwidth and routers
• Besides, content service providers can enter into bilateral agreements with an
ISP at any stage
• ISPs which perform peering or multi-homing share some of their revenue
based on equipment and resource utilization
19
Introduction
• How does the internet provide services for distributed
applications (i.e., programs written in Java, C, etc.)?
• Distributed means that applications run independently on the
hosts or end systems
• Messages are exchanged by the hosts using the internet socket
interfaces of their respective applications
• Protocols define the format and the order of messages
exchanged between two or more hosts
• Protocols also define the actions taken on the transmission
and/or receipt of a message or other event
• Services (e.g., reliability, guaranteed rate) are provided by
hardware or software associated with the devices
20
Classification by topography and functionality
21
COMPUTER COMMUNICATION NETWORKS
24
Network edge
• Home access networks
• An infrastructure handled by a telecom or cable or fiber operator
• General architecture is given below
Core
Multiplexer Network
Router
Home
Modem
25
Network edge
Feature DSL based Cable TV based FTTH based
access network access network access network
Modem DSL modem Cable modem Optical modem
Local Splitter Fiber node Optical network
multiplexer terminator
Central office DSL access Cable modem Optical line
(CO) multiplexer terminating terminator
(DSLAM) system (CMTS) (OLT)
Downlink rates 12 Mbps [ITU DOCSIS 2.0 100 Mbps
1999] and 24 standard 42.8 (cable length
Mbps [ITU Mbps based)
2003]
Uplink rates 1.8 Mbps [ITU DOCSIS 2.0 30 Mbps (cable
1999] and 2.5 standard 30.7 length based)
26
Mbps [ITU Mbps
Network edge
• Enterprise access network
• ISP can be telecom operator
• Built using Ethernet cables, switches and hubs
• Ethernet switches are preferred over routers in a LAN
• Routers are used for separating the network into subnets
27
Network edge
• Wireless networks:
• Classified according to radio access technologies
• Spread spectrum, frequency hopping, random access, polling methods, etc.
• More complex compared to wired access networks
• Packet losses and time varying wireless channel characteristics
• Wireless networks can be WiFi-based or cellular-based
• Wireless networks are usually supported by telecom ISPs
• Span of wireless networks can be few meters to several kilo meters
• Wireless networks have undergone tremendous evolution especially with the
exploding data requirements of the users
28
Network edge
• Satellite access networks:
• Remote end systems get access to the internet via satellite links
• Implemented when other access networks are not feasible
• Has lowest data rates among access networks
• The delays are higher. It depends on the distance between the satellite and
the users and the type of satellite
• Types of satellites: geostationary satellites and low-earth orbiting (LEO)
satellites
29
COMPUTER COMMUNICATION NETWORKS
Cisco NCS6000
router
31
Network core
• Network core is part of
the internet which is
composed of high-speed
packet switches and
high-speed
communication links
• Network core is
constructed using the
interconnection of ISPs
• The packet switches
(routers) perform store
and forward operation
32
Network core
• Traffic from access ISPs are aggregated using multiplexers
• Multiplexers are interconnected to more distant switches through a
backbone network
• Network core follows mesh topology with lot of redundancy
• Some design problems in network core include:
• Satisfy delay and reliability constraints
• Routing
• Assigning capacity (Flow maximization problem)
• Cost improvement
33
Network core
• Routers in the network core perform switching
• Routers have several links on which packets arrive and depart
• Switching involves transfer of an incoming packet from one link to an
appropriate outgoing link based on IP protocol
• The switching operation can be done by hardware and/or software
• Different types of switching performed in the network core
• Circuit switching
• Packet switching
34
Network core
• Circuit switching:
• Requires connection establishment before data transfer
• Resources are allocated by every intermediate
switch/router between the source and destination
hosts
• Resource example: Fixed link bandwidth, internal
memory
• In telephony, when a path is established between the
source and destination we can say a circuit is formed
• After data transfer, the circuit is closed by releasing the
reserved resources at each intermediate router
• No waiting time and no loss of data at intermediate
routers
• Throughput reduces with resource sharing
35
Network core
• Circuit switching:
• A circuit in a link is established either by frequency
division multiplexing (FDM) or time division
multiplexing (TDM)
36
Network core
• TDM- Time division multiplexing:
• Time is divided into frames and frames into slots
• Slots in a frame are reserved for the transmitting hosts
• Each slot ends with a guard time to prevent ISI
• Duration of frame, slot, guard time are fixed
37
Network core
• FDM- Frequency division multiplexing:
• Bandwidth is divided into channels
• All channels reserved for transmitting hosts in a fixed slot time
• Channel reservation done slot-by-slot-basis
• Channels separated by guard band to prevent adjacent channel interference
38
Network core
• Numerical #1:
• How long does it take to send a file of 640,000 bits from host A to host B over
a circuit-switched network?
• All links are 1.536 Mbps
• Each link uses TDM with 24 slots/sec
• Guard time is equal to (1/8)th of the slot time
• 500 msec to establish end-to-end circuit
39
Network core
The user needs one slot per frame
Frame size =1 s
Number of bits transmitted by a user per frame (Nbs) = link rate * effective transmission time per slot =
1.536M * 36.458m = 56 kilobits
Number of frames needed to transmit (Nf) = file size/bits per slot = 640000/56000 = 11.42 frames = 12
frames (even if the fraction of a slot is required, the entire slot is meant for that user)
Total delay
40
= connection setup time + (Nf-1) * frame duration + 1 slot duration = 500m + 11 * 1sec + 1/24 =
11.0916 sec
Network core
• Numerical #2:
• How long does it take to send a file of 640,000 bits from host A to host B over
a circuit-switched network?
• Available link rate is 1.536 Mbps
• Link rate is distributed across 10 channels of 200 kHz
• Guard band of 50 Hz is used
• 500 msec to establish end-to-end circuit
41
Network core
42
Network core
• Packet switching:
• Data broken into smaller chunk called packets
• No reservation of resources
• Suited for bursty traffic
• Better link utilization
• Packets are stored in buffer and then forwarded one at a time
• Requires protocols for link access and reliable packet delivery
43
Network core
• Packet switching (contd.):
• Packets may suffer queuing delays and get lost at the routers
• This happens when rate of arrivals exceeds the rate of departure
44
Network core
• Packet switching versus Circuit switching – Case 1:
• Suppose users share a 1 Mbps link. Also suppose that each user alternates
between periods of activity when a user generates data at a constant rate
of 100 kbps, and periods of inactivity when a user generates no data.
Suppose further that a user is active only 10 percent of the time.
• With circuit switching, 100 kbps must be reserved for each user at all
times.
• Thus, the circuit-switched link can support only 10 (= 1 Mbps/100 kbps)
simultaneous users.
45
Network core
• Packet switching versus Circuit switching – Case 1:
• With packet switching, the probability that a specific user is active is 0.1. If there are 35
users, the probability that there are 11 or more simultaneously active users is approximately
0.0004.
• Each user is using the channel 10% of the time, so the probability of a given user
being active is p = 0.1, and inactive q = 0.9.
• It's a binomial distribution X ~ B(35, 0.1), so probability Pr(X=k) = C(35, k) pk q(35-k).
• Pr(X>10) which is 1 - Pr(X<=10) which is 1-(Pr(X=0) + Pr(X=1) + ... Pr(X=10)) =
0.0004
• When there are 10 or fewer simultaneously active users (which happens with probability
0.9996), the aggregate arrival rate of data is less than or equal to 1 Mbps.
• When there are more than 10 simultaneously active users, then the aggregate arrival rate of
packets exceeds the output capacity of the link, and the output queue will begin to grow.
• Thus, packet switching performs same as circuit switched TDM but serves more than three
times the number of users.
46
Network core
• Packet switching versus Circuit switching – Case 2:
• Suppose there are 10 users and that one user suddenly generates
one thousand 1,000-bit packets, while other users remain quiescent
and do not generate packets.
• Under TDM circuit switching with 10 slots per frame and each slot
consisting of 1,000 bits, the active user can only use its one-time slot
per frame to transmit data, while the remaining nine-time slots in
each frame remain idle. It will take 10 seconds
• Under packet switching, the active user can continuously send its
packets at the full link rate of 1 Mbps, since there are no other users
has packets for transmission. In this case, it will take 1 second
47
COMPUTER COMMUNICATION NETWORKS
49
Delay, loss and throughput
❑ Processing delay: Time taken to inspect (or make) a packet
at a packet switch (or source host). Range: Microseconds
❑ Queuing delay: Time spent by a packet in the queue
before processing. Depends on the number of packets
waiting ahead, traffic intensity and distribution of the
arrival process. Range: Microseconds to milliseconds
❑ Transmission delay: Time taken to push a packet on to the
link. Depends on length of the packet (L bits) and link rate
(R bits/sec). Expressed as L/R
❑ Propagation delay: Time taken by a bit to travel over a
link. Depends on the length of the link and the physical
medium’s propagation speed (e.g., 2×108 to 3×108 m/s).
50
Delay, loss and throughput
❑ Traffic intensity versus queuing
delay
❖ Suppose arrival rate is a packets
per sec and departure rate is
L/R seconds per packet, then
traffic intensity is given by La/R
❖ Let buffer size be infinite
❖ When La/R < 1, every new
packet sees an empty queue
❖ When La/R ≥ 1, queue starts to When buffer is finite
build up and mean queuing and La/R ≥ 1, then
delay could approach infinity packet losses occur
51
Delay, loss and throughput
• End-to-end delay (dend-end): The total time spent by a packet to travel from
the source to the destination.
• End-to-end delay is the sum of the delays at the source, delays at each
packet switch and the propagation delays on each communication link
along the path.
• Delay at a packet switch equals the sum of queuing delay, processing
delay and transmission delay
• Consider N–1 identical and uncongested routers between the source and
destination. Let all N links be identical. Let propagation delay on any link,
transmission delay, and processing delay at any router and source be
denoted by dprop, dtrans and dproc respectively. What is the end-to-end
delay?
52
Delay, loss and throughput
• Numerical #3:
• For the scenario given below, assume the queuing delay, propagation delay
and processing delay to be negligible. Suppose packet length L = 7.5 Mb and
link rate R = 1.5 Mbps. Calculate the end-to-end delay.
53
Delay, loss and throughput
• Throughput is the rate (bits/sec) at which the destination host
receives the packets.
• Instantaneous throughput is the throughput at a given time instant
whereas average throughput is throughput over the entire file
transfer time (e.g., F/T where F is file size and T is file transfer time).
• Example: What is the maximum achievable throughput?
54
COMPUTER COMMUNICATION NETWORKS
Performance parameters
Throughput
▪ Packet transmission rate (bits/sec) between a pair of sender-receiver
❖ Rs < Rc the bits pumped by the server will “flow” right through the
router and arrive at the client at a rate of Rs bps, giving a
throughput of Rs bps.
R bits/sec R bits/sec
s c
R bits/sec R bits/sec
s c
56
COMPUTER COMMUNICATION NETWORKS
Performance parameters
Throughput (contd.)
● Note also that if bits continue to arrive at the router at rate Rs , and
continue to leave the router at RC , the backlog of bits at the router
waiting for transmission to the client will grow and eventually
packet loss will occur
R bits/sec R bits/sec
s c
57
COMPUTER COMMUNICATION NETWORKS
Performance parameters
Throughput (contd.)
Consider 10 clients
downloading from 10
servers
Assume bottleneck
link is shared equally
among different
packet flows
Per-connection end-
end throughput:
min(Rc,Rs,R/10)
58
COMPUTER COMMUNICATION NETWORKS
Numerical 3:
Calculate the total time taken in transmission of 20,000 bits from Host A to
Host B. The data is divided into 4 packets of 5000 bits each. All four links
have an identical rate of 2 Mbps and are 10 km long. Assume optical links
and no processing & queuing delays.
60
COMPUTER COMMUNICATION NETWORKS
Performance parameters
61
• Numerical 5: Suppose there is a 10 Mbps microwave link between a
geostationary satellite and its base station on Earth. Every minute the
satellite takes a digital photo and sends it to the base station. Assume
a propagation speed of 2.4×108 m/s.
What is the propagation delay of the link?
What is the bandwidth-delay product, R · dprop?
Let x denote the size of the photo. What is the minimum value of x for the microwave link to be continuously
transmitting?
• Solution:
Propagation delay is (36000 km)/(2.4×108 m/s) = 150 ms
Bandwidth-delay product 1500 kb
Time between photo transmission is 60s therefore, transmit 600 Mb
62
• Numerical 6: Consider the figure below where transmission
delay is the only significant delay. Each link is 2Mbps.
Suppose the number of links N is 3. Calculate the end to end
delay for the two cases given below. Note that each switch is
a store and forward switch.
1. If message of size 8 Mb is transferred without segmentation.
2. If the message is segmented into 800 packets of 10 kb length.
63
64
Numerical #7:
65
COMPUTER COMMUNICATION NETWORKS
68
Protocol layers and their service
• Arranged vertically, the layers on the systems
collectively constitute the protocol architecture
• Two types of protocol architecture were proposed
• TCP/IP model
• OSI model
• TCP/IP model or TCP/IP protocol suite
• Resulted from protocol research under ARPANET
• Consists of large collection of protocols issued as
Internet standards issued by IAB
• It consists of 5 layers namely, Application layer,
Transport (host-to-host) layer, Network layer (IP layer),
Link layer (network access layer), Physical layer
69
Protocol layers and their service
• Application layer :
• Applications running on hosts
generate/receive data
• Data is referred to as message
• A process initiates communication
with another by sending a
query/request
• Message is formatted according to
the application layer protocol
• Messages can be big in size
• Applications can have QoS
requirements
70
Protocol layers and their service
• Transport layer:
• Responsible for providing QoS for
messages
• Performs multiplexing at the sender
• Performs demultiplexing at the
receiver
• Maps each message to a
corresponding process
• Appends a new header to each
message
• Message plus header is called
segment
71
Protocol layers and their service
• Network layer:
• Fragments segments into packets
• Moves packets hop-by-hop
• E.g., router to router
• Uses source and destination IP
addresses
• Path between source host and
destination host is discovered
• Appends a new header to each
packet
• Packet plus header is called
datagram
72
Protocol layers and their service
• Link layer:
• Pushes the packets onto a link
• Using link layer protocols
• Can forward frames using MAC
address
• Appends a new header to the
packet
• Packet plus header is called frame
• Provides synchronization at receiver
• Checks for errors in frame
73
Protocol layers and their service
• Physical layer:
• Provides physical interface between
the host and the link
• Example: Modem and Ethernet card,
wireless adapter
• Converts binary data into signals
• Performs modulation and
demodulation
• Performs transmission, reception
and filtering of signals
74
Protocol layers and their service
Encapsulation happens before departure
Decapsulation happens after arrival
Encapsulatio
n
Decapsulatio
n
75
COMPUTER COMMUNICATION NETWORKS
78
Application layer architectures
• Client-server architecture
• Client initiates the process communication
• Server responds to requests from the clients
• Server is always ON
• Server is well defined (e.g., IP address)
• Server can handle concurrent connections
• Examples: Search engines, Internet commerce,
Web-based email, Social media
79
Application layer architectures
• Peer-to-peer architecture
• Any host can send and receive data
• Hosts can join and leave the network any time
• Hosts allocate resources to help each other
• P2P architectures are self scalable
• Distributed algorithms are used for a) Maintaining state information and b)
For file sharing
• Examples: Bit Torrent, Skype
80
Processes communicating
• Processes exchange messages with one another using the rules
governed by the end-systems operating system
How to read/write a
message?
When to read/write a
message?
81
Transport layer services
82
Transport layer services
• Applications and the supported protocols
83
Application–layer protocols
• Application layer protocols define the following
• The types of messages exchanged, for example, request messages
and response messages
• The syntax of the various message types, such as the fields in the
message and how the fields are delineated
• The semantics of the fields, that is, the meaning of the information in
the fields
• Rules for determining when and how a process sends messages and
responds to messages
84
COMPUTER COMMUNICATION NETWORKS
86
Web and HTTP: Overview
• HTTP request-response behaviour
What transport layer protocol is
used?
1. Persistent TCP
2. Non-persistent
TCP
87
Web and HTTP: Non-persistent
Separate TCP connection to
fetch each object (including base
webpage)
Used in HTTP/1.0
88
Web and HTTP: Persistent
• Compared to non-persistent connections, persistent
HTTP we save total access time and the efforts in
establishing TCP connections
• For each of these connections, TCP buffers must be
allocated and TCP variables must be kept in both the
client and server.
• In persistent HTTP connection, only one TCP
connection is established (for base webpage) and all
objects are fetched back-to-back
• Server closes connection after some specified time of
inactivity
• Used in HTTP/1.1 (allows up to 6 parallel TCP
connections)
• Used in HTTP/2 (includes multiplexing, message
prioritization and server pushing)
89
Web and HTTP
• Numerical #7: Consider accessing the webpage
ww.someSchool.edu/someDepartment/Schoolpage.html
which contains two embedded objects. Suppose the Web
server and client are connected by a long link of rate R.
Let RTT denote the two way propagation delay. Suppose
the length (bits) of the webpage and two objects are L 1, L2
and L3 respectively. Suppose the HTTP request message is
of negligible length and can be piggybacked with
acknowledgements. Calculate separately, the total access
delay under a persistent TCP connection and
non-persistent TCP connections. Show the timing
diagram.https://chatgpt.com/share/66e54c6c-9034-8006
-b13a-7a5f92874bae
90
COMPUTER COMMUNICATION NETWORKS
92
Web and HTTP: Message format
• Example-GET message:
• Request webpage www.gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file.html
93
Web and HTTP: Message format
94
Web and HTTP: Message format
• Web server sends the response message which could have the requested object
95
Web and HTTP: Message format
96
Web and HTTP: Message format
97
COMPUTER COMMUNICATION NETWORKS
• Most commercial websites provide access through user identification. These special identities are called cookies
99
Web and HTTP: Web caching
10
0
Web and HTTP: Web caching
10
1
COMPUTER COMMUNICATION NETWORKS
103
DNS: Domain Name System
• Example: Sending HTTP request to a web server 1st time
Upon receiving the DNS reply, the encapsulation of the TCP handshake
(i.e., TCP connection request) segment resumes using the IP address
obtained for the web server.
This TCP segment is passed to the web server
106
DNS: Domain Name System
• Example: Sending HTTP request to a web server 1st time
Web server replies with a TCP handshake (i.e., TCP connection grant) of
its own from port 80
107
DNS: Domain Name System
• Example: Sending HTTP request to a web server 1st time
Upon receiving the TCP handshake from the web server, the host
performs encapsulation of the HTTP request and then sends it to the
web server
108
DNS: Domain Name System
The problems with a centralized design include:
109
DNS: Domain Name System
• Distribution of DNS servers
110
DNS: Domain Name System
• Hierarchy of DNS servers
• Root DNS servers
• TLD DNS servers
• Authoritative DNS Server
111
DNS: Domain Name System
• Root DNS servers
• Root DNS servers are the first level of DNS servers which are contacted by the
clients to query DNS resource records.
• http://www.root-servers.org/ offers a map view of the root DNS servers
around the world
• The name, IP address and location of the root DNS servers can be obtained
from the above link
• 13 root DNS servers (actually 247 servers) across the world are maintained by
12 independent organizations
• https://www.iana.org/domains/root/servers provides list of root server zones
112
DNS: Domain Name System
• Root DNS servers
113
DNS: Domain Name System
• TLD DNS servers
• TLD DNS servers maintain domain level information.
• For each of the top-level domains—top-level domains such as com, org, net, edu, and
gov, and all of the country top-level domains such as uk, fr, ca, and jp—there is TLD
server (or server cluster).
• Verisign Global Registry Services maintains the TLD servers for the com top-level
domain, and the company Educause maintains the TLD servers for the edu top-level
domain
• https://domainpunch.com/tlds/ gives list of TLD servers and their associated domains
• Authoritative DNS servers maintain various DNS records corresponding to
the registered hosts
• Local DNS servers are proxy servers which reside in an access network
• They query the DNS hierarchy on behalf of the respective clients
114
DNS: Domain Name System
❑ Summary of services:
❖ Provides IP address for a given host name
❖ Host aliasing
❖ Mail server aliasing
❖ Load distribution
115
COMPUTER COMMUNICATION NETWORKS
118
Type MX query and
response
119
DNS: Domain Name System
• DNS servers and the types of records they maintain
• Authoritative DNS server 🡪 Type A, MX
• Root DNS server 🡪 Type NS
• TLD server 🡪 Type A and NS
• Local DNS server 🡪 All types
120
DNS: Domain Name System
121
Iterative DNS query mechanism
DNS: Domain Name System
122
Recursive DNS query mechanism
DNS: Domain Name System
• How to update your website with DNS?
• Find a registrar
• Available at http://www.internic.net
• Registrars are authorized by ICANN
• Submit names and IP address of your primary
authoritative DNS server and secondary DNS (if any)
• Registrar creates Type NS and Type A records
• One each for primary and secondary servers
• Registrar inserts these records into the TLD DNS server
• You can insert records into your authoritative DNS
servers
• Type A records of your web servers
• Type A record and MX record of your mail server
123
DNS caching and vulnerabilities
• Caching
• Reduces network traffic
• Reduces delay in DNS response
• Vulnerabilities
• Denial of service attack
• Attackers are distributed
• Client cannot query to the DNS server as it is choked with DNS queries from attackers
• Spoofing
• Attackers mimic a client and send DNS queries
• Client is choked with DNS responses
• Man-in-the-middle attack
• Client-to-server message and/or server-to-client message is altered by malicious users
• Digital signatures can be used as a remedy
124
COMPUTER COMMUNICATION NETWORKS
Outgoing messages in a
126
mailbox are handled by SMTP
Electronic email
• Overview:
• Email message is composed by a sender using the user agent (e.g.,
web browser or Outlook).
• The email is uploaded to the mailbox of the sender using the Simple
Mail Transfer Protocol (SMTP) over TCP
• A mail server hosts the mailboxes of many clients
• A TCP connection is established between the mail servers of the
sender and the recipient of the email message
• SMTP pushes (moves) the message from the sender to the recipient's
mailbox (i.e., the sender’s mail server to the recipient’s mail server).
The port number is 25
• The recipient pulls the message from his/her mailbox using mail
access protocols to read it.
127
SMTP
Email has three major components: user agents, mail servers, and
the Simple Mail Transfer Protocol (SMTP)
SMTP is the principal application-layer protocol for Internet
electronic mail.
It uses TCP’s reliable data transfer service to transfer mail from
the sender’s mail server to the recipient’s mail server.
SMTP has two sides: a client side, which executes on the sender’s
mail server, and a server side, which executes on the recipient’s
mail server
SMTP does not normally use intermediate mail servers for sending
mail, even when the two mail servers are located at opposite ends
of the world.
128
Electronic email
• SMTP is defined in RFC 5321 and is much older than HTTP
• SMTP is invoked by sender’s mail server
• Messages between mail servers are encoded in ASCII
129
SMTP
• Alice’s user agent uses SMTP or HTTP to deliver the e-mail message to
her mail server
• Then Alice’s mail server uses SMTP (as an SMTP client) to relay the
e-mail message to Bob’s mail server
• There are two common ways for Bob to retrieve his e-mail from a mail
server.
• If Bob is using Web-based e-mail or a smartphone app (such as
Gmail), then the user agent will use HTTP to retrieve Bob’s e-mail.
• The alternative method, typically used is to use the Internet Mail
Access Protocol (IMAP)
• SMTP cannot be used here, why?
130
SMTP
• Operation
131
SMTP
• Comparison with HTTP
• HTTP allows other encoding formats but SMTP strictly
follows ASCII
• SMTP is a “push” type protocol while HTTP is a “pull”
type protocol
• SMTP does not distinguish between object types in its
data exchange.
132
COMPUTER COMMUNICATION NETWORKS
134
Video Streaming and Content Distribution Networks –
Internet video
• A video is a sequence of images, typically being displayed at a constant rate
(e.g., 24-30 images/sec)
• An uncompressed, digitally encoded image consists of an array of pixels
• Each pixel is encoded into a number of bits to represent luminance and
colour
• Compression algorithms can achieve any bit rate desired
Video quality Bit rate Resolution
SD 800-1000 kbps 480p
HD 1.2-2 Mbps 720p
FHD 1.9-4.5 Mbps 1080p
135 UHD 10 Mbps 2160p
Video Streaming and Content Distribution
Networks – DASH
• Youtube was the earliest to adopt DASH
• Dynamic adaptive streaming refers to varying the video
resolution (bit rate) in response to the changes in the available
bandwidth at the client
• Multiple video resolutions are made available at the content
server (low resolution ⇒ low bit rate)
• Each video for a given resolution has an associated URL and a
set of chunks (e.g., 4 sec video fragment)
• A client makes a TCP connection to the content server and
requests for the manifest file corresponding to the video
• A manifest file which provides a URL for each version along
with its bit rate
136
Video Streaming and Content Distribution
Networks – DASH
• Upon learning the available versions, it chooses the version
of the chunk to request using HTTP GET
• This depends on the rate adaption algorithm and
available bandwidth
• The content server sends the requested chunk using the
HTTP response message
• The client’s application buffers the received chunks up to a
threshold before play out
• DASH has to ensure that the chunks are maintained above
the threshold of the receive buffer
137
Video Streaming and Content Distribution
Networks – CDN
• The objective of DASH is to ensure the quality of experience for the client
after a server is chosen
• The objective of CDN is to maintain the videos closer to the clients and
resolve server assignment for video streaming
• The CDN is a distributed architecture of server clusters placed on which the
contents are placed by a pull (Youtube) or push (Netflix) approach
Enter Deep Bring Home
Large number of small clusters Small number of large
clusters
Deployed in access ISPs (e.g., Deployed in IXPs (e.g.,
Akamai) Limelight)
Challenge
138
of maintenance and Challenge of delay and
Video Streaming and Content Distribution Networks –
CDN Operation
• Content providers distribute the video (different versions) to
the CDN company
• When a client wants to access a video on the content
providers webpage, the DNS servers help locate the server
cluster under the CDN, and locate the appropriate server
• Following this the TCP connection is established to the server
and then HTTP based DASH takes over during streaming
• Example, let KingCDN distribute videos of Netcinemas
• Let a client accesses Transformers 7, bearing the URL
http://video.netcinema.com/6Y7B23V, from NetCinema
webpage. See the sequence of operations next
139
Video Streaming and Content Distribution Networks –
CDN Operation
140
COMPUTER COMMUNICATION NETWORKS
143
Transport layer: Services
• UDP
• Connectionless protocol
• Does not acknowledge transmitted segments
• No throughput regulation(i.e., could cause network congestion)
• No service guarantees
• process-to-process data delivery and error-checking
• Example applications?
• TCP
• Connection-oriented protocol
• Adapts throughput according to network congestion(congestion control)
• Supports flow control at the receiving node
• Guarantees reliable data transfer under the unreliable network layer
• Example
144
applications?
Network layer: Services
The Internet’s network-layer protocol has a name—IP, for Internet Protocol.
IP provides logical communication between hosts.
The IP service model is a best-effort delivery service.
• This means that IP makes its “best effort” to deliver segments between
communicating hosts, but it makes no guarantees.
• It does not guarantee segment delivery, it does not guarantee orderly
delivery of segments, and it does not guarantee the integrity of the data in
the segments.
• For these reasons, IP is said to be an unreliable service.
145
Transport layer: Sockets
• At any given time there can be more than one socket in the
receiving host, each socket has a unique identifier. The format of
the identifier depends on whether the socket is a UDP or a TCP
socket
• Sockets allow matching the transport layer segments to their
respective sockets
• Sockets are used in multiplexing and demultiplexing of segments
• Analogy for sockets:
• You can perform various transactions with your bank account
(application) through an ATM (end-system) and bank-side server
(end-system). You have various options (sockets) such as balance
enquiry, withdrawal, change of ATM PIN, etc.
146
Transport layer: Multiplexing and demultiplexing
147
Transport layer: Multiplexing and demultiplexing
148
Transport layer: Multiplexing and demultiplexing
149
Transport layer: Multiplexing and demultiplexing
150
Socket examples
• Connection oriented transport (two-way)
151
Socket examples
• Connection oriented transport (two-way)
152
Socket examples
UD TC
P P
153
COMPUTER COMMUNICATION NETWORKS
156
Connectionless transport: UDP
No connection establishment.
TCP uses a three-way handshake before it starts to transfer data. UDP just
blasts away without any formal preliminaries. Thus UDP does not introduce
any delay to establish a connection.
No connection state.
TCP maintains the connection state in the end systems. This connection
state includes receive and send buffers, congestion-control parameters, and
sequence and acknowledgment number parameters. UDP does not maintain a
connection state and does not track any of these parameters.
158
Connectionless transport: UDP
159
Connectionless transport: UDP
• Segment structure:
❖ Source port is used for multiplexing and
demultiplexing at the sender
❖ Destination port is used for multiplexing
and demultiplexing at the receiver
❖ Length specifies message length plus
header length in bytes
❖ Checksum (RFC1701) is used for error
detection at the receiver
Sender side: Split the segment into 16-bit numbers and sum them. Wrap around
carry (if any). Take 1’s complement of the sum (call this UDP checksum)
Receiver side: Recompute checksum including UDP checksum. If answer is all 1s
then
160it means no error has occurred
Connectionless transport: UDP
• Segment structure (contd.):
• Checksum example:
• Assume three16-bit words of the form
161
COMPUTER COMMUNICATION NETWORKS
Connectionless Transport UDP
CHECKSUM CALCULATION
Checksum calculation at the sender side:
a) The given data is split into 16-bit numbers (some zeros are padded if the
given data is not an integral multiple of 16).
b) The 16-bit numbers are summed and the carry is wrapped around and
added back to the resulting sum.
c) Take one complement of the sum and this result is called "checksum".
b) The data is split into 16-bit numbers (some zeros are padded if the given data is not an
integral multiple of 16).
c) The 16-bit numbers are summed and the carry is wrapped around and added back to the
resulting sum.
e) Data is treated as intact if the resulting sum contains only ones; Otherwise data was
163
corrupted.
COMPUTER COMMUNICATION NETWORKS
Connectionless Transport
Checksum example:
● Assume segment has 3 16-bit words
164
COMPUTER COMMUNICATION NETWORKS
Connectionless Transport