0% found this document useful (0 votes)
256 views51 pages

CZ3006 Net Centric Computing Notes

The document discusses network layers and data link layer concepts. It covers: 1) The benefits of using layered network models like OSI include simplicity, flexibility, and allowing incremental changes. 2) The OSI 7-layer model defines layers and protocols for peer-to-peer communication between machines. Each layer encapsulates data and passes it to the lower layers. 3) The TCP/IP model has 5 layers including the application, transport, network, link, and physical layers. Each layer adds header information and passes the new data unit to the lower layer.

Uploaded by

Feng Chengxuan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
256 views51 pages

CZ3006 Net Centric Computing Notes

The document discusses network layers and data link layer concepts. It covers: 1) The benefits of using layered network models like OSI include simplicity, flexibility, and allowing incremental changes. 2) The OSI 7-layer model defines layers and protocols for peer-to-peer communication between machines. Each layer encapsulates data and passes it to the lower layers. 3) The TCP/IP model has 5 layers including the application, transport, network, link, and physical layers. Each layer adds header information and passes the new data unit to the lower layer.

Uploaded by

Feng Chengxuan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 51

CZ3006 Net Centric Computing

Lecture 2 – Network Layer & Physical Resilience

Benefits of Layers:

 Simplicity – Easy to design once layers and their interactions are defined clearly
 Flexibility – Easy to modify and develop networks by separate layers & modifications
 Incremental Changes – Easy to add new layers, add new functions to a layer

OSI 7-Layer Model

 Function Decomposition – Weakly-decoupled stack


 Encapsulation – Each layer adding new headers
 Peering – Only peer layer communicating with each other
 Protocols:
o Layer n in one machine interacts with layer n in another machine to provide a
service to layer n + 1 -> peer processes
o Machine use a set of rules & conventions called the layer-n protocol
o Layer-n peer processes communicate by exchanging Protocol Data Units
(PDUs)

 Services:
o Indirect and virtual communication between peer processes
o Layer n+1 transfer information by invoking the services provided by layer n
o Services are available at Service Access Points (SAP)
o Each layer passes data & control to the layer below it until the physical layer
is reached and transfer occurs

1
o Data passed to the layer below is called Service Data Unit (SDU)
o SDU are encapsulated in Protocol Data Unit (PDU)

TCP/IP Model

 5 Layers:
o Application: support network application
o Transport: host data transfer
o Network: routing of datagrams from source to destination
o Link: data transfer between neighbouring network elements (e.g. PPP, Ethernet)
o Physical: bits on the wire
 Each layer takes data from above
o Adds header information to create new data unit
o Passes new data unit to layer below

Network Reliability

 Mean Time Between Failures (MTBF) = Mean Time to Failure (MTTF) + Mean Time to
Repair (MTTR)
 Link Failure Probability: percentage of the time during which the link is dysfunctional
 Link Availability: percentage of time during which the link is functional

2
Lecture 3 – Data Link Layer (DLL): Flow Control

 Data Link Layer (DLL) Services:


o Framing – encapsulate each network-layer datagram within a link-layer frame
before transmission over the link
o Link Access – MAC protocol specifying the rules by which a frame is
transmitted onto the link
o Flow Control: control of data flow to ensure sender not overwhelm the
receiver with data
o Reliable Delivery: move each network-layer datagram across the link without
error
 Framing:
o Byte Oriented (Character Oriented): 8-bit basic unit; Some of the units are
used for signalling

o Bit Oriented (HDLC): Flag used to frame the bits sent; Header used to
describe the content of a frame; Used by all modern protocols (Ethernet,
PPP, HDLC)
 Link Configuration/Access:
o Determine who gets to transmit at when on a link
o Topology: physical arrangement of stations
 Point-to-Point: pairs of hosts are directly connected (send out
multiple times to different stations)
 Broadcast: all stations share a single channel (sent out once, all
stations receive -> highly unreliable)
o Duplexity:
 Half Duplex: Only one party may transmit at a time
 Full Duplex: Allows simultaneous transmission and reception between
two parties’
 Flow Control: Ensures that a transmitting station does not overwhelm a receiving
station with data & No frame error
o Stop and Wait:
 A packs binary information into a frame
 A sends the frame to B
 A wait for an ACK
 When B has received the frame, B sends an ACK
 When A has received the ACK, A repeats

3
o Throughput (U) = time that link carries useful information / total time = T frame /
Tcycle

o Ignoring Tack & Tproc,


 Tcycle = Tframe + 2 Tprop
 U = Tframe / (Tframe + 2 Tprop) = 1 / (1 + 2a)
 a = Tprop / Tframe
 U = 1 / 1+2a where a is Normalized Propagation Delay
o Disadvantages of Stop-and-Wait:
 If frame or ACK is lost, long waiting time is expected; Using a TIMEOUT
control in the sender
 If propagation time is long, the sender must wait a long time before it
can perform the next transmission -> use buffers at the
sender/receiver (sliding window operation)
 Sliding Window Flow Control:
o Allows multiple frames to be in transit
o Sender and Receiver have buffer N long
o Sender can send up to N frames without receiving ACKs
o Each frame is numbered
o ACK includes number of next expected frame
o Sequence No. bounded by field size (k bits)
 Frames are numbered modulo 2k
 Sequence number [0, 2k-1]

4
- Sender maintains a window
containing frame numbers that
can be transmitted
- Sender window shrinks from
trailing edge (left side) as frames
are sent
- Frames are buffered at the
sender until acknowledged
- Receiver maintains a window as
well, its window shrinks from the
trailing edge as frames are
received
- Receiver’s window expands
from the leading edge (right side)
as ACKs are sent
- Sender’s window expands from
the leading edge as ACK are
received
- Receiver can acknowledge
frames without permitting
further transmission (by sending
a Receive Not Ready (RNR)
frame) Receiver must send a
normal acknowledgement to
resume
- ACK can be piggybacked on the
data frames in the reverse
direction

 Sliding Window Performance: Dependent on Parameter a (normalized propagation


delay) & Window size, N
o If N >= 2a + 1, Station can transmit continuously without exhausting its
window (U = 1.0)
o If N < 2a + 1, Station’s window is exhausted at t = N, the station cannot send
additional frames until t = 2a + 1 (U = N/1+2a)
o Tuseful = N * Tframe
o Tcycle = Tframe + 2 * Tprop

5
Lecture 4 – Data Link Layer (DLL): Error Control
Error Detection

 Parity Check (Odd/Even Parity): A single bit is appended to the original message
(usually 7 bit) to describe the message characteritics

o Even Parity: The total number of 1s is even


o Odd Parity: The total number of 1s is odd
o However, parity can only detect odd number of errors
 Cyclic Redundancy Check (CRC): multiple parity bits are appended to the original
message

Error Correction Technique – Automatic Repeat Request (ARQ)

 Forward Error Correction (FEC): Send more redundant bits in the message
 Automatic Repeat Request (ARQ):
o Retransmission after timeout: The source retransmits a frame when an
expected ACK fails to return within a predetermined time duration
o Retransmission when requested: The destination replies a negative ACK to
inform the source about an error. The source then retransmits the corrupted
frames accordingly

- Sliding Window (Go-back-N ARQ):


Frames are accepted strictly in
sequence
- Sliding Window (Selective-Reject
ARQ): Frames which arrive out of
sequence but are within the open
window at the receiver are accepted

6
Stop-and-Wait ARQ - Sender: transmits a single frame and
waits for ACK
- Receiver: If frame received correctly,
send an ACK; If not, just discard the
frame or send a NAK
- Sender:
 If ACK is received properly,
transmit next frame.
 If NAK received, retransmit
the same frame.
Performance:
 If no ACK is received within
timeout, transmitter timeouts,
and retransmits the same
frame.
 If ACK is damaged, transmitter
will not recognize it,
transmitter will timeout and
retransmit the same frame.
Receiver gets two copies of
the same frame, discard one.

Go-Back-N ARQ - Sender: transmits frames


sequentially based on sliding window
- Receiver:
 For error free frames, ACKs
are sent (also know as
Receiver Ready (RR))
 If damaged frame is received,
NAK (REJ) is sent. It discards
that frame and all subsequent
frames until erroneous frame
is received correctly
* With k bit sequencing, max window size is 2 k – 1
- Sender:
(If receiver received full 8 frames & ACK lost, sender
will think the receiver did not receive and send the 8
 If NAK is received, retransmit
frames again but the receiver is on the next window. that frame and all subsequent
There will be error as the receiver will put the first frames
frame as the second window)

7
Selective Reject ARQ - Only rejected frames are
retransmitted and those that time
out
- Receiver informs transmitter of
rejected frame n by sending ‘NAK n’
- After receiving an erroneous frame,
subsequent frames are accepted by
the receiver and buffered
- After receiving the valid copy of the
error frame, frames are put in proper
order and passed to the higher layer.
- Minimizes retransmission, and thus
Performance: more efficient than Go-back-N
- Receiver requires more complex
buffer management

8
Lecture 5 – Local Area Network (LAN): Introduction

 LAN is a computer network that covers a small area (few km)


 Higher Data rates as compared to WANS (10Mbps to 40 Gbps)

LAN Topologies: Bus, Tree, Ring and Star

Bus and Tree -Multipoint medium


- Transmission propagates throughout
medium
- Heard by all stations:
 Need to identify target station
(Each station has unique address)
- Full duplex connection between station
and tap
 Allows for transmission and
reception
- Need to regulate transmission
 To avoid collisions (If two stations
transmit at the same time, signals
overlap)
 To avoid continuous transmission
for a single station -> Transmit Data
in small blocks (frames)
- Terminator absorbs frames at end of
medium
Ring - Repeaters are joined by point to point
links in closed loop
 Receive data on one link and
retransmit on another
 Links are unidirectional
 Stations attached to repeaters
- Data frames
 Circulate past all stations
 Destination recognizes address and
copies frame
 Frame circulates back to source

9
where it is removed
Star - Each station connected directly to central
node (using a bi – directional) link
- Central node can broadcast
 Physical star, but logically like bus
since broadcast
 Only one station can transmit at a
time; Otherwise, collision occurs
- Central node act as frame switch
 Retransmits only to destination

Media Access Control (MAC)

 Assembly of data into frame with address and error detection fields
 Static Channel Allocation
o TDM:
 Each user is statically allocated one time slot
 If a particular user does not have anything to send, that period is
wasted
 User may not utilize the whole channel for a time slot
o FDM:
 Channel is divided to carry different signals at different frequencies
 Efficient if there is a constant (one for each slot) number of users with
continuous traffic
 Dynamic Channel Allocation
o Round Robin:
 Each station has a turn to transmit (Declines or transmits up to a
certain data limit; overhead of passing the turn in either case)
 Performs well if many stations have data to transmit for most of the
time (Otherwise passing the turn would cause inefficiency)
o Reservation:
 Used for stream traffic where time on the medium is divided into
slots (like TDM)
 Reservation can be made in centralized or distributed fashion
o Contention:
 All stations contend to transmit
 No control to determine whose turn is it
 Stations send data by taking risk of collision
 Used in Aloha, CSMA
 Good for busy traffic
 Efficient under light or moderate load
 Performance is bad under heavy load

10
Lecture 6 – Medium Access Control (MAC) Protocols

 Single shared broadcast channel


 Two or more simultaneous transmissions (Collison if node receives 2 or more signals
at the same time)
 MAC Protocol:
o Distributed algorithm to share the channel
o Communication about channel sharing must use channel itself
 Ideal MAC Protocols:
o When one node transmits, it can send at rate R
o When M nodes want to transmit, each can send at average rate R/M
o Full decentralized (No synchronization of clocks, slots & No special node to
coordinate transmission)
 Random Access Protocols
o When node has packet to send:
 Transmits at full channel data rate of R
 No prior coordination among nodes
o Two or more transmitting nodes -> Collision
o Design aspects:
 Whether to sense channel status
 How to transmit frames
 How to detect and react to collision
ALOHA

 Assumptions:
o All frames of the same size
o Time is divided into equal size slots, time to transmit 1 frame
o Nodes are synchronized
o Nodes start to transmit frames only at beginning of slots
o If 2 or more nodes transmit in slot, ALL nodes detect collision

11
Efficiency:
- Result of a slot:
 Successful (S): only 1 node
transmits
 Collision (C): >2 nodes
transmit
 Empty (E): no transmission
- If there are N nodes in each slot,
each node transmits with probability
p:
 If a node I transmits, the
probability that the
transmission is successful is
Pr(Si) = p(1 – p)
 Probability that a slot is
successful is Pr(S) = N p(1-p)(N-
1)

- G = Np (Expected total number of


transmissions in a slot)
- Pros:
 Single active node can
continuously transmit at full
rate of channel
 Highly decentralized: only
slots need to be sync
 Simple
- Cons:
 Collisions, wasting slots
 Empty slots
 Clock synchronization

12
- Frames are transmitted at arbitrary
times
- Although it is simpler as no
synchronization is needed, collision
probability increases:
 Frame sent at t0 collides with
other frames sent in [t0 – 1, t0
+ 1]

* Throughput for pure ALOHA is half


of the slotted R, only half of the node
can be transmitted

Carrier-Sense Multiple-Access (CSMA) - To improve performance, avoid


transmissions that are certain to
cause collisions
- Based on the fact that in LAN,
propagation time is very small
 If a frame was sent by a
station, all stations knows
immediately so they can wait
before start sending
 A station with frames to be
sent, should sense the
medium for the presence of
another transmission(carrier)
before it starts its own
transmission
Vulnerable time = Maximum
Propagation Time
*The longer the propagation delay,
the worse the performance protocol
Non-persistent CSMA - A station with frames to be sent,
should sense the medium:
 Step 1: If medium is idle,
transmit

13
 Step 2: If medium is busy,
wait a random amount of
time and repeat step 1
- Non-persistent stations are
Performance: respectful to other stations
- Random delays reduces probability of collisions
between two stations with data to be transmitted
would wait for different amount of times
- Bandwidth is wasted if waiting time(backoff) is
large because medium will remain idle, following
end of transmission even if one or more have
frames to send
1-Persistent CSMA - To avoid idle channel time, station
wishing to transmit listen to the
medium:
 Step 1: If medium is idle, it
will transmit immediately
 Step 2: If medium is busy, it
Performance:
will continuously listen until
- If two or more stations becomes ready at the
medium becomes idle, then
same time, collision guaranteed
transmit immediately with
probability 1
P-Persistent CSMA - Time is divided into slots where
each time slot = maximum
propagation delay
- Station wishing to transmit listens
to medium:
Performance:  Step 1: If medium is idle,
- Reduces the possibility of collisions like non- transmit with probability p OR
persistent wait one time unit (slot) with
Reduce channel idle time like 1-persistent probability (1-p) then repeat
step 1
 Step 2: If medium is busy,
continuously listen until idle
then repeat Step 1

14
CSMA with Collision Detection (CD)

 CSMA has channel wastage: If a collision has occurred, colliding packets are still to
be fully transmitted
 CSMA with Collision Detection (CD) overcomes this:
o While transmitting, the sender is listening to medium for collisions
o Sender stops transmission if collision has occurred, reducing channel
wastage
o Widely used for bus topology LANs
 Collision detection:
o Transceiver: A node monitors the media while transmitting. If the observed
power is higher than the transmitted power of its own signal, it means
collision occurred

o Hub: If input occurs simultaneously on two ports, it indicates a collision. Hub


send a collision presence signal on all ports
 CSMA with CD Protocol:
o If a collision is detected by a station during its transmission, it should do the
following:
 Abort Transmission
 Transmit a jam signal to notify other stations of collision so that they
will discard the transmitted frame also to make sure that collision
signal will stay until detected by the furthest station
 After sending the jam signal, wait for random amount of time
 Transmit frame again

15
Lecture 7 – Wired LAN: Ethernet
Ethernet Frame Format

 Addresses (6 byte) – Destination Address & Source Address:


o Unique, 48-bit unicast address assigned to each adapter
o Broadcast: all 1s
o Multicast: first bit from the right of the first byte is 1
 Type field is a demultiplexing key used to determine which higher-level protocol the
frame should be delivered to
 Body can contain up to 1500 bytes of data

 Ethernet uses CSMA with Collision Detection (CD): listens to line before/during
sending
 If line is idle, send packet immediately
 If line is busy, wait until idle and transmit packet immediately (1-persistent sending)
 If collision detected, stop sending and jam signal
Ethernet Minimum Frame Size

 To ensure that there are no other transmissions on the medium before it ends its
transmission, frame transmission >= 2* Propagation time (t)
Ethernet Jam Signals

 B’s transmission cannot be too brief, otherwise A might not see the collision
 To avoid this, a station is required to transmit a jam sequence (32-48 bits) after it has
detected a collision to make the collision more obvious

16
Ethernet Problems:

 Peak utilization is pretty low


 Peak throughput worsens with more hosts & longer links
Binary Exponential Backoff (BEB)

 Based on the Binary Exponential Backoff (BEB), when a collision is detected by the
station, it can discard the packet and let the upper layer protocols do the
retransmission
 Delay time:
o 1st time: choose K from {0,1} then delay K * 51.2us
o 2nd time: choose K from {0,1,2,3} then delay = K*51.2us
o Nth time: Delay = K* 51.2us for K = 0...2n – 1 (max value is 1023)
o Give up after several tries (usually 16) & Report error to host
 If delay were not random, then there is a chance that sources would retransmit in
lock step
 Choose from small set for K (works for small number of hosts; large number of nodes
would result in more collisions)

Collision Domain

 Network region in which collisions are propagated (Repeaters & Hubs)


 Collision frequency can be kept low by breaking the network into: bridges, switches,
routers
Broadcast Domain

 Network region in which broadcast frames are propagated


 Broadcasts are necessary for network function
 Some devices and protocols produce lots of broadcast, avoid them
 Broadcast frequency can be kept manageable by limiting the LAN size
 LAN can then be cross-connected by routers to make a larger inter-network

17
Shared – Hub Switch

- A repeater/hub forwards the received - A switch/ switching hub forwards the


signals to all output ports except the received signals only to the destination
incoming port -When two transmissions arrive at the
- A collision occurs when two computers switch at the same time, they will be stored
transmit at the same time. In this case, the in different buffers so that their frames can
channel carries no useful information be forwarded later. No collision is resulted
 Switches forward and filter frames
based on LAN addresses
 Scalable
 Connect two or more segments by
copying data frames between them
 Higher link bandwidth
 Much greater aggregate bandwidth
- Creates several collision domains, more
transmissions at one time & Scales well
- Supports multi data rate (10/100Mbps)
switching
- Store and forward switch (Accept input &
Buffer it briefly)
- Cut through switch (Begin repeating
incoming frame onto output line as soon as
the destination address is recognised)
Performance:
- Unused lines can be used to switch other
traffic
- Duplex transmissions, it doubles overall
capacity

Lecture 8 - Wireless LAN: IEEE 802.11

18
 Advantages of Wireless LANs:
o Flexible deployment
o Minimal wiring difficulties
o More robust against disasters
o Historic buildings, conferences, trade shows
 Disadvantages of Wireless LANs:
o Low bandwidth compared to wired networks (1 – 10 Mbit/s)
o Proprietary solutions
o Need to follow wireless spectrum
 Wireless Link Characteristics:
o Decreased signal strength: radio signal attenuates as it propagates through
mater
o Interference from other sources
o Multipath propagation
 Extended Service Set
o Basic Service Set (BSS): Stations and the AP within the same radio coverage
o Extended Service Set (ESS): Several BSSs connected through Aps form an ESS

 802.11b: 2.4GHz – 2.485 GHz spectrum is divided into 11 channels at different


frequencies:
o AP admin chooses frequency for AP
o Interference possible: channel can be same as that chosen by neighbouring
AP
o Host: must associate with an AP –
 Scans channels, listening for beacon frames containing AP’s name
(SSID) and MAC address
 Selects AP to associate with
 May perform authentication (security purpose)
 Will run DHCP to get IP address in AP’s subnet

19
 Passive Scanning: Hosts listen for beacon frames from Aps and probe responses;
Hosts only scans once per second
 Active Scanning: Hosts transmits a probe request and listens for a probe response
from an AP
802.11 MAC
Sublayer:

 New Challenges caused by the nature of wireless communications:


o Broadcast
o Signal attenuation
o Pervasive electromagnetic noise
o Hidden Terminal Problem
o Exposed Terminal Problem
 Three functional areas:
o Access Control (random access vs controlled access)
o Reliable data delivery

Access Control:

 Distributed Coordination Function (DCF)


o Distributed access protocol
o Contention-based
o CSMA with CD
o Suited for Ad-hoc network and asynchronous traffic
 Point Coordination Function (PCF)
o Alternative access method on top of DCF
o Centralized access protocol
o Contention-free, and works like polling
o Suited for time-bound services like voice and multimedia

20
Reliable Data Delivery

 Loss of frames due to noise, interference and propagation effects


 Frame exchange protocol
o Sender broadcasts data
o Receiver responds with acknowledgement (ACK)
o If sender does not receive ACK, it retransmits frame
 Four frame exchange for enhanced reliability
o Sender issues request-to-send (RTS)
o Receiver responds with clear-to-send
o Sender transmits data
o Receiver responds with ACK

Hidden Terminal Problem – Caused by barrier/signal attenuation

Collision Avoidance: Sender to “reserve” channel for a long data frame

 Sender first transmits a small request-to-send (RTS) packet to receiver using CSMA
o RTSs may still collide with each other, or an RTS may collide with an ongoing
data frame (short)
 Receiver broadcasts clear-to-send9CTS) in response to RTS
 CTS heard by all nodes
o Sender transmits data frame
o Other stations defer transmissions

21
Exposed Terminal Problem

 The ongoing transmission from A to B will prevent C from transmitting to D because


C’s carrier sense tells C that the channel is occupied. However, C can transmit to D
because A signal is weak at D. This results in opportunity wasting.
802.11 Frame

Multi-Access Reservation Protocol (MARP)

 Two-Phase Protocol:
o Phase 1: Reservation
o Phase 2: Data Transmission

 Assume channel utilization is in reservation phase: Sr


 Number of reservation trial frames to reserve the channel: X
o X = 1 (the first trial succeeds) with probability of S r
o X = k (first k-1 trial, the kth trial succeeds with probability of S r(1- Sr)k-1
o Geometric distribution, so E[x] = 1/ Sr
o Average transmission window is u + v/ Sr

22
23
Lecture 9 – Mobile Access Networks: From 1G to 5G
Characteristics of Selected Wireless Link Standards

Cell Network Architecture

Techniques for sharing mobile-to-BS radio spectrum:

 Combined FDMA/TDMA: divide spectrum in frequency channels, divide each channel


into time slots
 CDMA: code division multiple access
Handover: transfer a call or data session from one cell to another within the same cellular
network
Roaming: the mobile moves from its home cellular network to a foreign network
Mobility: Spectrum of mobility, from the network perspective:

24
 Home network: permanent “home” of a mobile
 Home agent: entity that will perform mobility functions on behalf of mobile, when
mobile is remote
 Permanent address: address in home network can always be used to reach mobile
 Care-of-address: address in visited network
 Visited network: network in which mobile currently resides
 Foreign agent: entity in visited network that performs mobility functions on behalf of
mobile
 Approaches to mobility:
o Routing: routers advertise permanent address of mobile-nodes-in-residence
via usual routing table exchange (not scalable to millions of mobile)
 Routing tables indicate where each mobile is located; no changes to
end-systems
o End-Systems:
 Indirect routing: communication from correspondent to mobile goes
through home agent, then forwarded to remote
 Direct routing: correspondent gets foreign address of mobile, sends
directly to mobile
 Mobility: Registration
o Step 1: Mobile contacts foreign agent on entering visited network
o Step 2: Foreign agent contacts home agent: “this mobile is resident in my
network”
o End result: Foreign agent knows about mobile, home agent knows location of
mobile
 Mobility via Indirect Routing
o Step 1: correspondent addresses packets using home address
o Step 2: Home agent intercepts packets, forwards to foreign agents
o Step 3: Foreign agent receives packets, forwards to mobile
o Step 4: Mobile replies directly to correspondent
 Mobile uses two addresses: Permanent address (used by
correspondent -> mobile location is transparent to correspondent) &
Care of address: used by home agent to forward datagrams to mobile
 Triangle routing: correspondent-home network-mobile (inefficient
when correspondent & mobile are in the same network)
 Mobile via Direct Routing:
o Step 1: Correspondent requests, receives foreign of mobile
o Step 2: Correspondent forwards to foreign agent
o Step 3: Foreign agent receives the packets, forwards to mobile
o Step 4: Mobile replies directly to correspondent
 Overcome triangle routing problem
 Non-transparent to correspondent: correspondent must get care-of-
address

25
 Accommodating Mobility with Direct Routing (in situation where mobile changes
visited network)
o Anchor foreign agent: Foreign Agent in first visited network
o Data always routed first to anchor Foreign Agent
o When mobile moves, new foreign agent arranges to have data forwarded
from old FA (chaining) -> contacts previous foreign agent
Handling Mobility in Cellular network

 Home network: network of cellular provider you subscribe to (e.g. SingTel, M1)
o Home Location Register (HLR): database in home network containing
permanent cell phone #, profile information (services, preferences, billing),
information about current location (could be in another network)
 Visited network: network in which mobile currently resides
o Visitor location register (VLR): database with entry for each user in network
o Could be home network

GSM: Indirect Routing to Mobile

26
Lecture 10 – Network Paradigms
Network Design:

 Approach 1: Smart intermediate nodes & dumb end systems e.g. Telecommunication
networks
o Achieve very complex traffic management but difficult to upgrade
 Approach 2: Dumb intermediate nodes & smart end systems e.g. Internet
o Attract innovation at application but difficult to manage traffic

Intermediate Switching Nodes

 Nodes may connect to other nodes, or to some stations


 Network is usually partially connected (Redundant connections for reliability)
 Two type of switching: Circuit switching (Telephone Calls) & Packet Switching (Data
communications)
 Packet Switching – Virtual Circuit Switching & Datagram Switching
Circuit Switching

 There is a dedicated communication path between two stations (end-to-end)


 The path is a connected sequence of links between network nodes. On each physical
link, a logical channel is dedicated to the connection
 3 Phase Communication:
o Circuit establishment (link by link)
 Routing & resource allocation (FDM or TDM)
o Data transfer
o Circuit disconnects
 Deallocate the dedicated resources
o The switches must know how to find the route to the destination and how to
allocate bandwidth (channel) to establish a connection
 Problem: Solved by packet switching
o Designed for voice service
o Resources dedicated to a particular call
o For data transmission, much of the time, the connection is idle
o Data rate is fixed (both ends much operate at the same rate during the entire
period of connection)

27
Packet Switching:

 Data are transmitted in short packets


o Typically, at the order of 1000 bytes
o Longer messages are split into series of packets
o Each packet contains a portion of user data plus some control information
 Control information contains at least
o Routing (addressing) information, so as to be routed to the intended
destination
 Store and forward
o On each switching node, packets are received, stored briefly (buffered) and
passed on to the next node
 Advantages:
o Line efficiency:
 Single node-to-node link can be dynamically shared by many packets
over time
 Packets are queued up and transmitted as fast as possible
o Data rate conversion:
 Each station connects to the local node at its own speed
o In circuit-switching, a connection could be blocked if there lack free
resources. On a packet switching network, even with heavy traffic, packets
are still accepted, yet causing an increased delay
o Priorities can be used:
 On each node, packets with higher priority can be forwarded first.
They will experience less delay than lower-priority packets
 Approach:
o Datagram
o Virtual circuit

Datagram - Each packet carries the full destination address


- Each packet is treated independently
-Packets may arrive out of sequence
-Packets are called datagrams
 Each packet is treated independently, with
no reference to packets that have gone
before: Each node chooses the next node on
a packet’s path
 Packets can take any possible route
 Packets may arrive at the receiver out of
order
 Packets may go missing
 It is up to the receiver to re-order packets
and recover from missing packets
Example: Internet

28
Virtual Circuit - A pre-planned route is established before any
packets are sent, then all packets follow the same
route
- Each packet contains a virtual circuit identifier
instead of destination address, and each node on
the pre-established route knows where to forward
such packets
 The node need not make a routing decision
for each packet

Datagram Virtual Circuit


-Network can provide sequencing - No call setup phase
(packets arrive at the same order)  Good for burst data e.g. Web applications
and error control (retransmission - More flexible
between two nodes)  If a node fails, packets may find an alternate
- Packets are forwarded more route
quickly  Routing can be used to avoid congested
 Based on virtual circuit parts of the network
identifier
 No routing decisions to
make
- Less Reliable:
 If a node fails, all virtual
circuits that pass through
that node fails

Delay in Packet Switched network Packet Transmission Time:

29
Lecture 11 – Network Layer: Internet Protocol
Internet Protocol (IP) is implemented at both hosts and routers
Characteristics:

 Basic Protocol Functions:


o Addressing
o Fragmentation
 Provides a connectionless unreliable best-effort (datagram) service:
o Connectionless: each packet is handled independently, no flow control
o Unreliable: no error control
o Best effort: no throughput guarantee, no delay guarantee, no Quality of
Service (QoS) guarantee
IPv4

 Version (VER): Version number of IP


 Internet Header Length (HLEN): Length of header (in multiples of 4 bytes). Typically
5, representing header length of 5*4 = 20 bytes
 Type of Service: ignore
 Total Length: Length of datagram including header (in bytes)
 Option Fields: ignore
 Protocol: Indicates the protocol that IP is carrying (01 for ICMP, 06 for TCP, 11 for
UDP)
 Header Checksum: Verifying the header is free from error
 Source and Destination IP Address: Indicates the IP addresses of source and
destination
IPv4 Header – Fragmentation fields

 Identification: For reassembly purpose, all fragments of a datagram contain the same
identification value
 Don’t Fragment (DF): If the flag is set, the datagram is not fragmented
 More Fragments (MF): The flag is set to 1 for all fragments except the last one
 Fragment Offset: Tells where in the current datagram this fragment belongs. All
fragments except the last one must be a multiple of 8 bytes, the basic fragment unit

30
Classful Addressing:

Special IPv4 Address (RFC 5735):

 Network and/or Host id – all ‘0’s: can only be used as source address; e.g. during
start up to get own IP in DHCP
o 0.0.0.0: host is on this network
o 0.0.0.10: host 10 on this network
 Network and/or Host id – all ‘1’s: can only be used as destination address
o 255.255.255.255: limited broadcast within this network (ARP)
o 155.69.255.255: directed broadcast on 155.69.x.x network
 Loopback Address (127.x.y.z)
o Internal loopback to same host. Useful for self-testing of network software

Subnetting:

 To indicate the length of extended network prefix, use a subnet mask w.x.y.z (bits
corresponding to extended network prefix are set to ‘1’s and ‘0’s otherwise)

Subnet Address Calculation:

 ‘slash’ notation: a.b.c.d/x where x indicates # bits for extended network prefix
(convert the subnet mask into binary then count the number of ‘1’s)

31
Maximum number of hosts in each subnet = 211 – 2 = 2046 because (11 bits of host
ID)
o Host ID = all ‘0’s indicates network/subnet ID number
o Host ID = all ‘1’s indicates broadcast address

Determine if destination IP address is within the same subnet:

 Exclusive OR the Source IP and Destination IP network address


 If result = 0 then same subnet else, different subnet

IPv4 Address Exhaustion:

 Inefficient use of address space


 32-bit IP address is just not enough for today’s global network and future growth
 Solution:
o Classless Inter-Domain Routing (short-term solution): Reduces wastage in
address allocation. Organizations will be given adequate but not excessive
address space
 Length of network id (Prefix) can be any length
o Network Address Translation (NAT) using Private IP address (not solve the
problem): A single machine with an IP address representing many computers
behind it. IP addresses require translation
o IP version 6, 128-bit space (long-term solution)

CIDR – Network mask

 The IP address consists of the Network ID and Host ID


 “/n” where “n” is the number of bits allocated to Network ID
 Variable length subnet mask

32
Router to router link

 An IP address needs to be assigned to each active interface of a router


 To optimise the use of IP address, we usually assigned a /30 to the link, e.g.
172.16.31.0/30

Network Address Translation

 By using a NAT-enabled router, only 1 IP address is required from ISP to support the
whole private network to connect to internet
 Controversial:
o Routers should only process up to layer-3 (NAT-enabled routers process up to
transport layer to change port number)
o Violates host-to-host concept of layer-3

IPv6 Header: Simplification

33
IP fragmentation & Reassembly

IP Routing: A host will not know how to send packets to destination outside its own
network. Hence, it is configured with a default gateway (router) to assist in the forwarding

 Routing Process:
o Network address: Destination Network address
o Cost: Arbitrary cost, number of hops
o Next hop: Who to past to next

 Address/Route aggregation: to reduce the size of routing tables


o Achieved by combining multiple small prefixes into a single larger prefix
called supernetting

 Longest prefix matching rule

34
 At source host, IP encapsulates upper layer data into packet. Then determine route
and MTU and fragment if needed
 At each router, IP determines next route and Maximum Transfer Unit (MTU) and
further fragment packets if necessary. If Data Fragment (DF) flag is set, then it is
simply discarded
 Finally, at the destination host, IP reassembles packets (if fragmented) before
returning data to upper layer
Address Resolution Protocol (ARP): communication protocol used for discovering the link
layer (MAC) address associated with a given Internet layer address (IP address)

 ARP packet is sent directly over Ethernet frame


 Since sending an ARP request/reply for each IP datagram is inefficient, hosts
maintain a cache of current entries. Typically the entries are configured o expire
after 2-20 minutes.

Internet Control Message Control: created for routers/hosts to report errors to the source.
It is the responsibility of the source to handle the reported problems

 ICMP packet is sent over IP packet, which in turn is sent over data link layer protocol
e.g. Ethernet (layer-3 protocol)
 Two types of ICMP messages: Error/ query
 ICMP echo request message is sent by a source host to query a router or destination
host, which will respond with an ICMP echo reply message

35
Ping Network Tool: test the reachability of a host/router. It operates by sending/receiving
ICMP echo messages

 ICMP error message is sent by a router or destination host to inform source host that
its datagram has been received in error and discarded
 The data section of ICMP error message will contain part of the original IP datagram
in error – the complete IP header and first 8 bytes of the payload

ICMP Time Exceeded:

 Time to live: counter used to limit the IP datagram lifetime, number of hops. The
counter is initialized with an integer value up to 255, and when it reaches zero, the IP
datagram is discarded
Tracert network tool: tracing a path from source to destination host

 Send a sequence of ICMP echo request over IP with TTL set to 1, 2, .. until the
destination is reached
 Implemented using UDP (layer-4) with unused port number (e.g. 33534) over IP

36
Lecture 12 – IP Routing Protocols
Router – device used to interconnect networks, and to forward packets by examining the
destination address in the IP header of each packet

 Routing Protocol: initialize/update routing table so that a route/path can be


determined
o Flooding: When a node receives a packet, it will forward the packet to all
other links except the incoming link. The packet will be labelled with a unique
identifier. Should the same packet return, the packet will be discarded
 Advantages: A packet will always get through if one or more path
exists (very robust)
 Disadvantages: Very wasteful of bandwidth, may cause serious
congestion, hence not used in the Internet
 Applications: Military applications & Ad hoc wireless networks
 Autonomous Systems (AS): group of routers under the authority of a single
administration
o Each AS is uniquely identified by a 2-byte or 4-byte
o Intra-AS Routing:
 Routing within an AS
 Protocols for Intra-AS routing are called Interior Gateway Protocols
(IGPs)
 Different AS can choose to run their preferred protocols
 Single admin, so no policy decision needed
 Can focus on performance
 Distance Vector Routing:
 Discover neighbours by multicasting request
 Exchange distance vectors with immediate neighbours only:
Response to request, periodic updates, triggered updates due
to changes
 Compute shortest path routes using Bellman-Ford Algorithm

 Problem: Count-to-infinity (cost goes to infinity) – A trigger


update & B trigger update
 Solution: Split Horizon with Poisoned Reverse: If B gets to Net
1 via A, then its update to A should indicate that Net 1 is
unreachable

37
o Inter-AS Routing:
 Routing between AS
 Protocols for Inter-AS routing are called Exterior Gateway Protocols
(EGPs)
 All AS must run the same standard protocol
 Different admin wants control over how its traffic are forwarded, who
routes through its network
 Policy may dominate over performance
 Link State Routing:
 Discover neighbours by multicasting Hello
 Construct Link State Advertisement Packet (LSA/LSP)
 Flood LSA/LSP to ALL Routers (during initial start-up/ when
there is a change in topology)
 Construct link state database
 Compute shortest-path routes
 Border Gateway Protocol:
 Configure border router to know its neighbours
 Exchange path vectors (routing information) with neighbours
 Select path based on policy
o Transit AS: Connected to other AS to carry transit traffic for its customers;
mainly the providers, i.e. ISPs
o Stub AS: Connected to only one other AS; typically, customer connected to its
provider. In fact, its not necessary to stub AS to run BGP since it has only 1
path to its ISP
o External peers (between different AS) are normally adjacent to each other
and share a subnet
o Internal peers may be in any subnet within the same AS
o Customer – Provider relationship: Customer pays the provider to send and
receive traffic
o Peer – Peer relationship: Two AS agree to transit each other traffic
o Path selection (policy-based):
 Import policy: may or may not select path offered (e.g. cost, business
relationships)
 Export policy: can filter routes you don’t want to tell neighbours
BGP Path Attributes

 AS-Path: A sequence of AS along the path


 Next-HOP: IP address of the border router that should be the next hop to the
destination
 Mult-Exit-Disc: Used by administrator to determine the exit interface to
neighbouring AS (Lower to higher priority)
 Local-Pref: Assigned by administrator to select between multiple path to an AS. This
is used to informed other BGP speakers in the same AS preference

38
 Aggregator: Contains the AS and IP address of the BGP speaker that performs route
aggregation
BGP route propagation:

 Check all incoming filters defined by BGP session. Ignore routes that are not allowed
 Insert route in the BGP table
 Compare the new routes with other routes in the BGP table with the same
destination prefix, and execute AS path selection
 If the new route is best. Set as preferred route
 Propagate the new best route to BGP neighbours
 Uses Shortest Path – AS Hop Count

39
Lecture 13 – Transport Layer (UDP and TCP)
Transport Layer: provides end-to-end service for transferring data between processes
(process-to-process communication); only implemented at end hosts

 A single transport layer is used to support multiple application processes through the
use of ports
 Multiplexing: gathering data from multiple processes and passing it to a single
network layer
 De-multiplexing: delivering of data from single network layer to different processes
correctly

 UDP (Datagram Service): Application layer is aware that UDP sends each message as
a datagram ->useful for broadcasting messages to users

 TCP (Byte Stream Service): Application layer views TCP as a channel for sending
stream of bytes, and is NOT aware that bytes are sent in blocks called segments
o Connection Management: A connection must be setup before data exchange
can be performed
o Flow Control: Sender will not overwhelm receiver
o Error Control: Receiver detects error, sender retransmits error packets
o Congestion Control: During transmission, sender detects network usage
(congestion) and adjust transmission rate

40
Port Addresses

TCP Header Format:

 Sequence Number (SN): Each TCP connection will start with a different SN called
Initial Sequence Number (ISN)
o The position of each data byte in the byte stream is labelled from ISN + 1, and
cycle back to 0 once reaching 232 – 1; i.e. 1st byte = (ISN + 1) mod 232, 2nd byte
= (ISN + 2) mod 232
o SN indicates the position of the 1st byte in each segment
o Increment ISN by 1 every 4-micro sec
 Acknowledgment Number (AN):
o SN of the next data byte expected from sender
o Also imply all bytes up to AN-1 have been received correctly
 Window Size (W):
o Indicate the number of bytes (also called credits) counting from AN that the
receiver is ready to accept
TCP Connection Management:

 Connection establishment: serves the following purposes


o Ensures both ends are ready to communicate
o Establish initial sequence number (ISN)
o Exchange parameter e.g. window size (in bytes)
o Allocate resources e.g. buffer space to support connection
 Connection starts with a synchronization (SYN) request

41
TCP: Connection Establishment

 TCP uses a 3-way handshake approach with positive acknowledgements

TCP: Connection Termination

Scenario 1: Scenario 2:

TCP Flow Control:

 Similar to sliding-window flow control in data layer


 Sender:
o Maintain a blue window representing bytes that can be transmitted without
ACK
o When segment is sent, shrink blue window from trailing edge
o Stop sending when blue window size = 0
o When ACK is received, new blue window size = W bytes starting from AN
 Receiver:
o Maintain a blue window representing bytes ready to accept
o When segment is received, shrink blue window from trailing edge
o If not ready to accept more segments, send ACK with credit W = remaining
blue window size
o If ready to accept more segments, send ACK with W > remaining blue window
size, and expand bleu window from leading edge
 Enhancements:
o Problem: Wasteful to send ACK only segment (40 bytes TCP + IP headers)
 Maximum <500ms, to avoid error-control timeout re-sent
 ACK every alternate segment received
 Piggy-backed ACK can be sent immediately

42
o Avoid silly window syndrome at sender: Wasteful for receiver to keep ACK
with small window when sender can send more
 Solution: Receiver ACK W=0 instead of small window size until free
buffer gets large; e.g. buffer half empty (Clark’s Solution)
 Solution: Send the 1st small segment, buffer the rest and send them
together when ACK is returned (Nagle’s Algorithm) -> creates another
problem: Delayed transmission of segments is unfriendly to real-time
traffic e.g. interactive internet games
 Both solutions are required to solve silly window syndrome

TCP Error Control: To guarantee reliable service to application layer when IP is unreliable

 Error types:
o Segments arrived out-of-order
 Detected based on SN in TCP header: re-order and ACK
o Segments duplicated
 Detected based on SN; discard and ACK
o Segments corrupted
 Detected based on checksum in TCP header
 Discard and wait for timeout retransmission
o Segments loss:
 Wait for timeout retransmission
Retransmission Timer:

 Measure Round Trip Time (RTT) and compute smoothed RTT (SRTT). The
Retransmission Time Out (RTO) is then derived from SRTT
 Jacobson’s Algorithm:

43
 Karn’s Algorithm:
o Each TCP connection measures the RTT from sending a segment to receiving
its corresponding ACK
o Typically, there is only one measure ongoing at any time
o If a segment is retransmitted due to timeout, ignore its measured RTT
because it is ambiguous weather the ACK is for 1st or re-transmission
o When retransmission occurs, set RTO = 2 * RTO

Congestion Control: To prevent senders from sending too much traffic to the network such
that it becomes overly congested and useless; informally, to be a “considerate user” of the
network

 TCP sender assumes network congestion when LOSS events occurred:


o Timeout or receiving duplicate ACKs
 Possibly due to queueing or buffer overflow at routers which are signs
of congestion
o Two phases:
 Slow Start
 Congestion Avoidance
o Two parameters:
 cwnd: Congestion Window, measured in number of MSS (maximum
segment size, typically 536 bytes, but can be changed by using TCP
options field)
 ssthresh: Slow Start Threshold defines the point to transit from slow
start to congestion avoidance phase; in practice, typically set large
value for initial ssthresh (half-maximum number of MSS)
o Maximum data bytes that can be sent without ACK =
min {W (in bytes), cwnd(in bytes) * MSS}

TCP Slow Start Phase: TCP Congestion Avoidance Phase:

44
45
Tahoe Algorithm: Reno Algo: Implement Fast Recovery

Calculation of TCP Throughput:

Bandwidth-delay (BD): number of bytes that is required to fill the pipe in both directions

 High BD means that a lot of bytes are required to fill the pipe thus require larger
window
 High BD could be caused by the transmission bandwidth

46
Lecture 14 – Application Layer: DHCP, DNS and HTTP
Dynamic Host Configuration Protocol (DHCP): to automatically configure with IP address,
default gateway, DNS, etc

 DHCP Discover – client requesting for DHCP server


 DHCP Offer – server responding to client’s request
 DHCP Request – client accepting server’s offer
 DHCP Acknowledge – server confirming the offer
 Designed to run over UDP with server listening at well-known port 67
 Instead of ephemeral part, DHCP is an exception where client is required to run at
well-known port 68
DHCP Discover –

 Host/DHCP client sends DHCP Discover message to destination address


255.255.255.255 (IP broadcast) since it does not know where the server is
 Client uses source IP address 0.0.0.0 since it does not have an IP address
 If client is able to receive unicast DHCP reply even without an IP address, set DHCP
message broadcast flag = 0. Otherwise, set it to 1
DHCP Offer –

 Based on received DHCP message broadcast flag, DHCP servers send DHCP via:
o IP unicast using offered IP as destination address (possible since client’s
physical address is known)
o IP broadcast to destination address 255.255.255.255
 Reason why client is not using ephemeral part:
o Could confuse other hosts which happened to be using the same UDP
ephemeral port as the DHCP client if IP broadcast is used

47
DHCP Request –

 Client selects one offer and sends DHCP request which includes the selected server
identifier
 DHCP Request is sent to destination address 255.255.255.255 (IP broadcast) so that
other DHCP servers will also receive it and know that their offers are being declined
 Client still uses source IP 0.0.0.0 since the offer is not confirmed yet
DHCP Acknowledge –

 Similar as DHCP Offer, DHCP Ack is sent via IP unicast or broadcast based on the
DHCP message broadcast flag.
 Once DHCP ACK is received, the client can start using the offered IP address within
the duration of the lease time, typically 1 day.
DHCP Release –

 To extend the lease, the process of DHCP Request/Ack is repeated


 To end the lease, the client sends DHCP Release via unicast to the server

48
DHCP Relay Agent: To enable DHCP server to support multiple subnets, relay agents are
required since IP broadcast 255.255.255.255 is only limited within a subnet

 To save the trouble of having dedicated relay agent in every subnet, some routers
have the added functionality to act as relay agent

Domain Name System (DNS): Given only the domain name of a server, how does a client
know the IP address to send to destination

 DNS – to resolve domain name to IP address


 Designed to run over the over UDP with server listening at well-known port 53
 For scalability, domain names are designed to be hierarchical; e.g. ece.toronto.edu
 Fully Qualified Domain Name (FQDN) is a completely specified domain name
consisting of a host name and a domain
 Given just the host name, a DNS resolver may resolve it based on configuration
 Hierarchy of name servers are set up to provide DNS services
o Each server is responsible for a zone of the DNS namespace
o A zone can be a node; e.g. edu server is authoritative for xxx.edu
o A zone can also consist for multiple nodes; e.g. virginia.edu server is
authoritative for xxx.virginia.edu, including xxx.cs.virginia.edu
 Data are stored as Resource Records (RRs)

49
 Name servers may be configured to support recursive or iterative queries:
o DNS client contacts the local name server
o Local name server will assist client to perform further queries if it does not
know the answer
o Root and TLD name servers (usually iterative) will only send a referral if they
do not know the answer
 DNS Query/Response Message Format

WWW and HTTP

 World Wide Web (WWW): network application which allows a client to access a file
from a server
 HyperText Transfer Protocol (HTTP): application layer protocol used by WWW. It is
designed to run over TCP with server listening at well-known port 80 – consists of
request/response messages
o Non-persistent HTTP: individual TCP connection/termination for each pair of
request/response to access one file – inefficient
o Multiple request/response messages within one TCP connection – efficient
for accessing multiple files in the same server

50
HTTP Request Message Format

Web Proxy (Cache): Improve performance by caching, reduce traffic load on costly access
link, monitor/filter contents
* Can be implemented without the knowledge of users/servers: The organization/ISP
configures its routers to intercept all web traffic and re-direct (mis-direct) them to its Web
proxy, which masquerades as the destination server

 Steps:
o Client request to proxy
o If content is not available, proxy requests to origin server
o Origin server responds to proxy
o Proxy responds to client
 If performance is import, an option for content provider is use the service of Content
Delivery/ Distribution Network (CDN)
o With CDN, a web request will be transparently re-directed, commonly
implemented using DNS re-direction with CNAME RRs

51

You might also like