CS - ECE438 Lec3 InternetOverview
CS - ECE438 Lec3 InternetOverview
Saksham Agarwal
1
ti
Recap: what is a computer network?
A set of network elements connected together, that implements a set of protocols for the purpose of sharing
resources at the end hosts
Switch Router
Link
End hosts
Recap: what do computer networks do?
A computer network delivers data between the end hosts
Source Path
Source
Des na on Des na on
ti
ti
ti
ti
Recap: Sharing the network (graph)
Source Path
Source
Des na on Des na on
ti
ti
ti
ti
Recap: Two approaches to sharing networks
• First: Reserva ons
• Reserve bandwidth needed in advance
• Must reserve for peak bandwidth
• Not-so-goods
• Handling failures
• Resource underu liza on
• Blocked connec ons
• Connec on set up overheads
• Per-connec on state in switches (scalability problem)
ti
ti
ti
ti
ti
Recap: Solu on: Packet Switching
• Break data into smaller pieces
• Packets!
• Not-so-goods
• Unpredictable bandwidth availability
• Unpredictable delay/latency
• Packet header overhead
ti
ti
ti
ti
Recap: Internet Design Goals
• Fundamental goal (#1): connec vity between exis ng interconnected networks
Switch Router
Here you go
Link 74.125.239.35
End hosts
DNS Server
Fundamental problem #2: Rou ng
• Rou ng packets through network elements (eg., routers) to des na on
• Given des na on address (and name), how does each switch/router know where to send the packet
• Such that packet reaches the des na on
Switch Router L2 L3
Link
End hosts
DNS Server
ti
ti
Ques ons?
ti
Fundamental problem #3: Forwarding
• Queueing and forwarding of packets at switches/routers
I1 O1 O1
I2 O1 O2
Switch Bu er
I3 O1 O3
I4 O1 O4
ff
Fundamental problem #3: Forwarding
• Queueing and forwarding of packets at switches/routers
I1 O1 O1 I1 O1 O1 O1 O1 O1
I2 O2 O1 O2 I2 O2 O2
I3 O1 O3 I3 O3
I4 O1 O4 I4 O4
I1 O1 O1
O1
One (virtual) queue I2 O2
per-output port, O2
per input port O1
I3 O3
O1
I4 O4
Header Data
fi
ti
ti
Switch processing and Queueing delay
• Processing delay
• Easy: each switch/router needs to decide where to put packet
• Requires checking header, etc
• Queueing delay
• Harder: depends on “how many packets are in from of me”
• Depends on network load
• As load increases, queueing delay increases
• In a reliable manner
• So, we can send packets from source to des na on
• Are we done?
• When a packet arrives at a host, what does the host do with it?
• To which process (applica on) should the packet be sent?
• If the packet header only has the des na on address, how does the host know where to deliver the packet?
• There many be mul ple applica ons on the des na on
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
And while we are nishing our story…
• Who puts the source address, source port, des na on address, des na on port in the packet header?
fi
ti
ti
ti
ti
The nal piece in the game: End-host stack
• Of Sockets and Ports
• When a process wants access to the network, it opens a socket, which is associated with a port
• Socket: an OS mechanism that connects processes to the network stack
• Port: number that iden es that par cular socket
• The port number is used by the OS to direct incoming packets
fi
ti
fi
ti
Implica ons for Packet Header
• Packet header must include
• Des na on address (used by network)
• Des na on port (used by network stack)
• And?
• Source address (used by network)
• Source port (used by network stack)
• When a packet arrives at the des na on host, packet is delivered to the socket associated with the des na on port
• The network stack at the source embeds the address and port for both the source and the des na on in
packet header
• Each router uses des na on address in the packet header to look up the outgoung link in the rou ng table
• And when the link is free, forward the packet