Networks Revision Notes
Networks Revision Notes
Transport Layer
Enables multiple processes on one host to communicate with multiple
processes on another remote host over the network(end-system
communication)
It hides the complex communication paths between 2 end systems
Implemented on the end systems
Transport layer protocol break message received from app layer into
segments and send them over the network via the network layer
On destination end system, transport layer receives segments from
network layer, reconstructs message and hands it over to the app layer
TCP/IP Networks
UDP (user Datagram Protocol) and TCP (Transmission Control Protocol)
IP(Internet Protocol) most common and important network protocol
IP Protocol provide logical communication between hosts(unreliable
services)
Main functions of a TCP:
Extending host to host delivery to process to process delivery
(Multiplexing/Demultiplexing)
Provide data integrity validation and error detection
UDP
o Unreliable, connectionless transport services
o Suitable for real time applications/ can tolerate packet loss
o Min packet header= 8 bytes divided into 4
o Source port number
o Destination port number
o Length (no. of bytes in segment)
o Checksum (error detection)
o No connection state/ no need to establish connection
o Segment divided into header + msg payload
TCP
o Reliable, connection-oriented transport services
o Full-duplex protocol
o Doesn’t support 1 to many communication or connections
o Establishing connection = 3 way handshake
Congestion Control
Packet loss: outcome of network congestion
Congestion occurs when too many end systems attempt to send data
simultaneously, which eventually overwhelms one or more routers
TCP sender responsible for:
Detecting congestion on the path to the receivers host
o Occurrence of timeout
o Receiving duplicate ack.
Reducing/limiting the rate at which it sends data over the congested
path
Managing congestion
Transmission rate R bps and K TCP connections are going through a link
Fair if average transmission rate of each connection gets an equal share of the link
bandwidth (R/K)
TCP congestion control except 2 scenarios
1. UDP is likely to crowd out TCP traffic in the presence of UDP connections.
2. Parallel TCP connections by the same process or application.
RDT v2.0
RDT over a Channel with bit errors assumptions:
1. Message corruption possible
2. No packet or message loss
3. No out of order packet or messages
Protocol in this case requires feedback from receiver.
Positive feedback = message integrity preserved
On negative acknowledgement sender will resend message until positive
feedback sent.
Sender needs buffer to store original message until positive acknowledgement
It is a stop-and-wait protocol
Problem that feedback itself may be corrupted
RDT v2.1
RDT with sequence number over a channel with bit errors
When sender resends packet after receiving corrupted feedback, new
problem that there will be duplicate packets at receiver side
Need to allow receiver to distinguish between old and new packets
Solution is to add sequence number field to the transport protocol header
section
RDT v3.0
RDT over a lossy Channel with bit errors assumptions:
1. Same as RDT 2.0
2. Msg/packet/acknowledgement might get lost
3. Sender is responsible for detecting lost packets and resolving them using
retransmission
Detecting packet loss: time-based retransmission mechanism using count-down
timer
1. Choose value for countdown timer
2. Start timer each time packet is sent
3. Respond to timer interrupt
4. Stop timer
RDF v3.0
1. Is a RDT protocol
2. It is inefficient (uses stop-and-wait pattern)
3. Alternating-bit protocol (packet seq. numbers alternate between 0/1)
Pipelining
Sender is allowed to send multiple packets without waiting for ack.
Range of sequence number must be increased
Sender and receiver sides may have to buffer more than 1 packet
2 ways to determine buffer size and seq. no. range
Go-Back N (GBN)
Selective Repeat (SR)
Go-Back-N
Sender can send up to N packets without waiting for ack.
At anytime there are U unacknowledged packets in the pipeline where U<=N
U=U-M where 1<=M<=N
1. Let base be the sequence number of the oldest unacknowledged packet.
2. Let nextseqnum be the smallest unused sequence number out of the range
of available sequence numbers.
3. Let [0, base-1] a set of sequence numbers corresponding to acknowledged
packets
4. Let [base, nextseqnum-1] a set of sequence numbers corresponding to
unacknowledged packets that have been sent
5. Let [nextseqnum, base+N-1] a set of sequence numbers that could be used
to send new packets before reaching the stop point (threshold)
When packets arrive out of order they will be ignored and retransmitted
Selective-Repeat (SR)
Sender uses timer to detect potential packet loss (each packet has a timer)
When timer of given packet expires the sender retransmits this packet and
resets the timer
When an ack. Is received its is only used as an indication of receiving a
specific packet
On the receiver side when a packet arrives within the allowed window size,
the packet is stored in a local buffer, and an acknowledgement is sent to
the sender
Receiver will have buffer of size N
Stop-and-wait protocol
With timer, acknowledgment, error detection, sequence number, and
buffering enable building a RDT protocol.
It is inefficient
Can not fully utilize available transmission rate
Network Layer
Responsible for enabling host-to-host communication services
2 main categories, data plane and control plane
2 main functions packet forwarding and packet routing
Forwarding: When packet arrives at router input link, router processes packet and
decides output link of that packet
Routing: finds route packet will take from the source to destination
Data plane
All services and functions that enable router to provide forwarding services
Includes:
Reading/writing packet data from input and output ports
Performing error checking
Matching packet to an output port
Typically implemented in the hardware
Forwarding decision is a per-router function that should take a few nanoseconds
Each router uses local routing table to support its packets forwarding decision
Control Plane
Enable routers to discover possible routes for packets from sender to
receiver
Software-defined Networking (SDN) is a modern approach to implement a
control plane in remote servers instead of routers.
Input ports
1. Terminates the incoming physical link at the router
2. Execute packet forwarding and matching and hand over the packet to the
switch fabric
3. Perform queuing if the packets arrival rate is higher than the forwarding
speed/ switch fabric
4. Forward control routing msg to the routing processor
5. Each input port has shadow copy of forwarding/routing table
Forwarding Packets
Destination based forwarding or generalized forwarding
Destination-based: based on destination IP address in packet header
Forward table used as lookup table where IP address associated with one
link interface (output port)
Lookup operations should be fast and constant
In addition the memory access time must be addressed using Ternary
Content Addressable Memory (TCAM)
Generalized forwarding: based on any set of header field values and not limited to
destination IP
Switching Fabric
Responsible for executing forwarding decisions made by router
Moves from 1 input buffer to output buffer
Switching rate indicates speed at which packets can be transferred to the
output port, measured as multiple of input/output line rate
3 types of switching fabrics
o Memory: simplest/ switching under direct control of CPU/ speed
limited by memory bandwidth/ packets can not be forwarded
simultaneously
o Bus: input transfers to output directly/ no intervention by router CPU
over shared bus
o Crossbar: design overcomes bus bandwidth limitations/ consists of
2N buses/ enable fragmenting packets into fixed-length chunks/can
transfer packets simultaneously
Scheduling
1. FIFO (first in first out)
2. Priority Queuing (packets assigned to classes)
3. Round Robin (also in classes but we take 1 from each class)
4. Weighted Fair Queuing (same us before each class gets weighted amounted
of service)
IPv4
Main protocol in IP/TCP
Addressing network interfaces
IP Fragmentation
Network links have MTU, largest possible link-level frame, different link
types, different MTUs
Large IP packets divided within the net one packer
Fragments are reassembled only at the final destination
Ethernet frame 1500 bytes while links and WANs is less that 576 bytes
IP addressing
Each host connected to physical network link through network interface
Network interface must have its own IP address
Ip address is written using dotted-decimal notation
Each IP address has a subnet part and a host part
Subnetting means dividing network into 2
IP address V6.0
Has fixed length header of 40 bytes
Addressing capabilities extended from 32 to 128 bits
V6 vs V4
V6 doesn’t support fragmentation and reassembly
V6 uses new version of ICMP
V6 doesn’t provide error detection
No optional field
Control Plane
Objective is to discover the least cost paths/routes
Could be achieved using per-router control/ logically centralized control
Routing protocols OSPF/BGP/RIP/EIGRP conventional routing approaches
SDN makes clear separation between data and control planes
Centralized algorithms
Least cost path using global knowledge
Graph structure known to every network
All routers see same network layout
Each router runs same routing algorithm to calculate forwarding table
Link-state algorithm
Decentralized algorithms
Goes to several iterations to calculate least cost path
Every router only knows direct connectivity of adjacent routers
Distance vector algorithms
Categorizations
Static vs dynamic routing
Static: do not assume network connectivity change very often
Dynamic: assume connectivity of network change and they run in response to
changes
Load sensitive vs insensitive based on reaction to link-state and traffic load
Intra-AS Routing
Large networks organized into autonomous systems
Routers within same AS are under a single administration
PA 8 Questions
CLASSES A B C
A = 0 , 24 hosts/ 8 networks
B = 10, 16 hosts 16 networks
C = 110, 8 host 24 networks
A route oscillation might occur if a destination is reachable from different paths, and when the link-state
algorithm operates in load-sensitive mode, the routes will continue to change.
A routing loop occurs when we use distance-vector to route packets and the network connectivity
changes such that a link cost changes or the link -state changes