OSI Model
OSI Model
switch
destination Hn Ht M network
M application Hl Hn Ht M link Hn Ht M
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
physical
Introduction: 1-10
Functions of Layers of OSI Model
1. Application Layer
• Topmost layer of the OSI model.
• Provides a user interface for exchanging information between users.
• End to end delivery
• Process to process communication.
• Hypertext Transfer Protocol (HTTP)
• Simple Mail Transfer Protocol (SMTP)
• File Transfer Protocol (FTP)
• Terminal Network (TELNET) and Secure Shell (SSH)
▪ permanent IP address
▪ often in data centers, for scaling
clients: local or
regional ISP
▪ contact, communicate with server
▪ may be intermittently connected home network content
provider
▪ may have dynamic IP addresses network datacenter
network
communicate
▪ peers request service from other
peers, provide service in return to
other peers local or
regional ISP
• self scalability – new peers bring new
service capacity, as well as new service home network content
demands provider
network datacenter
application application
socket controlled by
process process app developer
transport transport
network network controlled
link by OS
link Internet
physical physical
request file
RTT
time to
transmit
file
time
file received
time
Functions of Layers of OSI Model (Ch# 23)
• A remote computer can run several server programs at the same time.
• we must define the local host, local process, remote host, and remote process.
• The local host and the remote host are defined using IP addresses.
Figure 23.1 Types of data deliveries
23.21
Socket Address (Ch# 23)
• To define the processes, we need second identifiers, called port numbers.
• ICANN has divided the port numbers into three ranges:
• Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled by
ICANN. These are the well-known ports.
• Registered ports. The ports ranging from 1024 to 49,151 are not assigned or controlled by
ICANN. They can only be registered with ICANN to prevent duplication.
• Dynamic ports. The ports ranging from 49,152 to 65,535 are neither controlled nor
registered. They can be used as temporary or private port numbers.
• Socket Addresses. A transport-layer protocol in the TCP suite needs both the IP address
and the port number, at each end, to make a connection. The combination of an IP address
and a port number is called a socket address.
Figure 23.3 IP addresses versus port numbers
23.23
Functions of Layers of OSI Model
4. Transport Layer
• Segmentation and Reassembly
• Divides large data from the Application Layer into smaller, manageable
segments for transmission.
• At the receiver end, these segments are reassembled to reconstruct the
original data.
• Multiplexing/Demultiplexing
• Congestion Control
• Flow Control
• Connectionless / Connection oriented services
Multiplexing at Transport Layer At Sender Side
Demultiplexing at Transport Layer At Receiver Side
Multiplexing/demultiplexing at Transport Layer
multiplexing as sender: demultiplexing as receiver:
handle data from multiple use header info to deliver
sockets, add transport header received segments to correct
(later used for demultiplexing) socket
application
router
▪ may indicate congestion level or
explicitly set sending rate
▪ TCP ECN, ATM, DECbit protocols
Transport Layer: 3-31
Flow Control
▪ Flow Control ensures that receiver is not overwhelmed by sender.
▪ People often are confused between congestion and flow control,
▪ Congestion means many host sending too much data
▪ Flow control means one sender sending too fast data to one receiver.
▪ Transport layer uses sliding window mechanism to for flow control
flow control: one sender too fast for one receiver
routing
Network Layer: 4-42
Network layer: Forwarding and Routing
Forwarding: Routing
▪ local, per-router function ▪ network-wide logic
▪ determines how datagram ▪ determines how datagram is
arriving on router input port routed among routers along end-
is forwarded to router end path from source host to
output port destination host
values in arriving
packet header
0111 1
2
3
Routing
Algorithm
Routing
forwarding
values in arriving
packet header
0111 1
2
3
Solution
We replace each group of 8 bits with its equivalent
decimal number.
IPV4 Address
Find the error, if any, in the following IPv4 addresses.
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
IPV4 Address
• A 32-bit IPv4 address is also hierarchical, but divided only into two parts.
• The first part of the address, called the prefix, defines the network;
• Second part of the address, called the suffix, defines the node (connection of a
device to the Internet).
Classful Addressing
• When the Internet started, an IPv4 address was designed with a fixed-length
prefix.
• But to accommodate both small and large networks,
• Later on address space was divided into five classes (class A, B, C, D, and E).
• This scheme is referred to as classful addressing.
Classful Addressing
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
19.53
Classful IP Addressing is Obsolete
• The reason that classful addressing has become obsolete is address depletion.
• Addresses were not distributed properly.
• Addresses being rapidly used up.
• resulting in no more addresses available for organizations and individuals using
internet.
• To understand the problem, let us think about class A.
• This class can be assigned to only 128 organizations in the world as (net id 0-127),
• But each organization needs to have a single network.
• 16,777,216 nodes can be connected to each of these networks.
• You rarely find such large organizations
• Most of the addresses in this class were wasted (unused).
Classful IP Addressing is Obsolete
• In Some cases there are addresses for the hosts in the network are too small to accommodate
all hosts for example
• Class C addresses have a completely different flaw in design.
• The number of addresses that can be used in each network (256) was so small that most
companies were not comfortable using a block in this address class.
Subnetting and Supernetting (Solution?)
• To alleviate address depletion, two strategies were proposed,
• Subnetting
• Supernetting.
• Subnetting is the procedure to divide the network into sub-networks or small networks,
• These smaller networks are known as subnets.
• In a subnet, a few bits from the host portion are used to design small-sized subnetworks from the
original network.
• In subnetting, network bits are converted into host bits.
• Supernetting is the procedure to combine small networks into larger spaces.
• In subnetting, Network addresses’ bits are increased. on the other hand, in supernetting, Host
addresses’ bits are increased.
Classless addressing
• Hosts in the internet were increasing day by day, address space was depleting.
• During the 1990s, Internet Service Providers (ISPs) came into prominence.
• An ISP is an organization that provides Internet access for individuals, small businesses,
and midsize organizations.
• 1996, the Internet authorities announced a new architecture called classless addressing.
• In classless addressing, variable-length blocks are used that belong to no classes.
• The prefix in an address defines the block (network); the suffix defines the node(device).
• Theoretically, we can have a block of 20, 21, 22, 232 addresses.(Power of 2)
• Slash notation is used for CIDR addressing
Extracting Information from CIDR Address
1. The number of addresses in the block is found as N = 232−n.
2. To find the first address, we keep the n leftmost bits and set the (32 − n)
rightmost bits all to 0s.
3. To find the last address, we keep the n leftmost bits and set the (32 − n)
rightmost bits all to 1s.
IPV4 Special Addresses
• Five special type of addresses are used in IPV4
• This-host Address
• Block 0.0.0.0/32 is called the this-host address.
• It is used whenever a host needs to send an IP datagram but it does not know its
own address to use as the source address.
• Limited-broadcast Address
• Block 255.255.255.255/32 is called the limited-broadcast address.
• It is used whenever a router or a host needs to send a datagram to all devices.
• Loopback Address
• 127.0.0.0/8 is called the loopback address.
• Private Addresses
• Four blocks are assigned as private addresses: 10.0.0.0/8, 172.16.0.0/12,
192.168.0.0/16, and 169.254.0.0/16.
• Multicast Addresses
• The block 224.0.0.0/4 is reserved for multicast addresses.
IPV6 ch 22
• Despite short term solutions to address depletion migration from
IPV4 to IPV6 is necessary due to large number of hosts connecting to
internet.
• An IPv6 address is 128 bits or 16 bytes (octets) long.
• Binary notation is used when the addresses are stored in a computer.
• Humans use colon hexadecimal notation (or colon hex for short.
• It divides the address into eight sections, each made of four
hexadecimal digits separated by colons.
Abbreviated IPv6 addresses
19.61
IPV6 Address Space
• An IPV6 address is 128 bit long which means there are 2128 are available which
equals 340, 282, 366, 920, 938, 463, 374, 607, 431, 768, 211, 456.
• An IPV6 address can be one of the following types:
• Unicast Address
• A unicast address defines a single interface (computer or router). The packet
sent to a unicast address will be routed to the intended recipient.
• Anycast Address
• A group of computer shares a single anycast address. A packet with an anycast
address is delivered to only one member of the group, the most reachable
one. Eg many servers installed request received by most reachable.
• Multicast Address:
• In multicasting a group of computer also shares the address, key difference is that In
anycasting, only one copy of the packet is sent to one of the members of the group;
in multicasting each member of the group receives a copy.
TRANSITION FROM IPv4 TO IPv6
• Dual Stack
• All hosts, have a dual stack of protocols during the transition.
• A station must run IPv4 and IPv6 simultaneously until all the Internet
uses IPv6.
TRANSITION FROM IPv4 TO IPv6
• Tunneling
• Tunneling is a strategy used when two computers using IPV6
• Packet must pass through a region that uses IPv4.
• To pass through this region, the packet must have an IPv4 address.
• So the IPv6 packet is encapsulated in an IPv4 packet when it enters
the region, and it leaves its capsule when it exits the region.
TRANSITION FROM IPv4 TO IPv6
• Header Translation
• Header translation is necessary when the majority of the Internet has
moved to IPv6 but some systems still use IPv4.
• The sender wants to use IPv6, but the receiver does not understand
IPv6. Header Translation can be used
Data Link Layer ch 9
• Nodes and links
• Two end hosts and the routers in networks are considered as nodes and the
networks in between as links.
• There can be two types of links
• Point to point link (Directly connects two nodes, hence complete bandwidth is
available)
• Multipoint link (the link is shared between several pairs of device)
• A packet at the data-link layer is normally called a frame.
Link layer: introduction
terminology: mobile network
▪ hosts, routers: nodes national or global ISP
Link Layer 67
Link layer: context
▪ datagram transferred by
different link protocols over
different links:
• e.g., WiFi on first link,
Ethernet on next link
▪ each link protocol provides
different services
• e.g., may or may not provide
reliable data transfer over link
Link Layer 68
Transportation analogy
transportation analogy:
▪ trip from Princeton to Lausanne
Princeton • limo: Princeton to JFK
JFK • plane: JFK to Geneva
• train: Geneva to Lausanne
▪ tourist = datagram
▪ transport segment =
communication link
▪ transportation mode = link-
layer protocol
▪ travel agent = routing algorithm
Geneva Lausanne
Link Layer 69
Link layer: services
▪ framing, link access: …
• encapsulate datagram into frame, adding …
header, trailer Cable access
• channel access if shared medium
• “MAC” addresses in frame headers identify
source, destination (different from IP
address!)
▪ reliable delivery between adjacent nodes
cellular
• we already know how to do this!
• seldom used on low bit-error links Ethernet LANs
• wireless links: high error rates
• Q: why both link-level and end-end
WiFi
reliability?
Link Layer 70
Link layer: services (more)
…
▪ flow control:
• pacing between adjacent sending and …
receiving nodes Cable access
▪ error detection:
• errors caused by signal attenuation, noise.
• receiver detects errors, signals
retransmission, or drops frame
▪ error correction: cellular
• receiver identifies and corrects bit error(s)
without retransmission Ethernet LANs
▪ half-duplex and full-duplex:
• with half duplex, nodes at both ends of link WiFi
can transmit, but not at same time
Link Layer 71
Link layer: Types of Errors
• In a single-bit error, only 1 bit in the data unit has
changed.
Types of
• A burst error means that 2 or more bits in the data
Errors
unit have changed
Burst
Single Bit Multi Bit
Error
10.72
Multiple access links, protocols
two types of “links”:
▪ point-to-point
• point-to-point link between Ethernet switch, host
• PPP for dial-up access
▪ broadcast (shared wire or medium)
• old-school Ethernet
• upstream HFC in cable-based access network
• 802.11 wireless LAN, 4G/4G. satellite
shared wire (e.g., shared radio: 4G/5G shared radio: WiFi shared radio: satellite humans at a cocktail party
cabled Ethernet) (shared air, acoustical)
Link Layer: 6-73
Multiple access protocols
▪ single shared broadcast channel
▪ two or more simultaneous transmissions by nodes: interference
• collision if node receives two or more signals at the same time
6-slot 6-slot
frame frame
1 3 4 1 3 4
frequency bands
FDM cable
6-slot 6-slot
frame frame
1 3 4 1 3 4
Link Layer 78
Interfaces communicating
application application
transport transport
cpu memory memory CPU
datagram network network
link link
3.82
3.83
Figure 3.18 Baseband transmission
3.84
Figure 3.20 Baseband transmission using a dedicated medium
3.85
OSI MODEL