CS162
Operating Systems and
Systems Programming
Lecture 16
Layering"
Application"
Skype "
Transmission"
Media"
SSH"
Coaxial "
cable"
NFS"
HTTP"
Fiber"
optic"
Packet"
Radio"
3/31/2014!
Anthony D. Joseph
!CS162
Lec 16.2!
Skype "
SSH"
NFS"
HTTP"
Intermediate "
layers"
Transmission"
Media"
3/31/2014!
Anthony D. Joseph
Coaxial "
cable"
Fiber"
optic"
!CS162
Packet"
radio"
3/31/2014!
Lec 16.3!
Page 1
Anthony D. Joseph
!CS162
Lec 16.4!
Must decide:!
Layering!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.5!
Protocol Standardization"
Anthony D. Joseph
!CS162
Service it provides:!
source
3/31/2014!
Anthony D. Joseph
!CS162
Lec 16.6!
destination
IP network
3/31/2014!
Lec 16.7!
Page 2
Anthony D. Joseph
!CS162
Lec 16.8!
Communication service!
Ordered, reliable byte stream!
Simultaneous transmission in both directions!
Properties of Layers!
Drawbacks of Layering!
TCP connection
source
3/31/2014!
Anthony D. Joseph
network
!
Note: Some slides and/or pictures in the following are adapted from slides
2005 Silberschatz, Galvin, and Gagne. Slides courtesy of Anthony D.
Joseph, John Kubiatowicz, AJ Shankar, George Necula, Alex Aiken, Eric
! Ras Bodik, Ion Stoica, Doug Tygar, and David Wagner.!
Brewer,
destination
!CS162
3/31/2014!
Lec 16.9!
Anthony D. Joseph
!CS162
Lec 16.10!
Datacenter!
DNS!
request!
create!
result!
page!
Search!
Index!
Q: What is a Facation? !
Load!
balancer!
Ad Server!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.11!
Page 3
Anthony D. Joseph
!CS162
Lec 16.12!
Network Concepts"
Network (interface) card/controller: hardware that
physically connects a computer to the network!
A computer can have more than one networking cards!
E.g., one card for wired network, and one for wireless network!
Process!
A!
Process!
B!
OS!!
!
OS!
!
!
!
!
Network cards!
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.13!
Anthony D. Joseph
!CS162
Lec 16.14!
Process!
A!
OS!!
!
!
IP Addr2!
MAC Addr2!
IP Addr1!
MAC Addr1!
3/31/2014!
Process!
A!
Process!
B!
IP Addr3!
MAC Addr3!
!
OS!
OS!!
!
!
!
!
!CS162
IP Addr2!
MAC Addr2!
IP Addr1!
MAC Addr1!
Network cards!
Anthony D. Joseph
Process!
B!
3/31/2014!
Lec 16.15!
Page 4
IP Addr3!
MAC Addr3!
!
OS!
!
!
Network cards!
Anthony D. Joseph
!CS162
Lec 16.16!
Application
Process!
A!
Process!
B!
Connection!
PortA!
PortB!
OS!!
!
!
IP Addr2!
MAC Addr2!
IP Addr1!
MAC Addr1!
3/31/2014!
IP Addr3!
MAC Addr3!
Port number
Wake-on-LAN
!
OS!
!
!
FTP data
20
FTP control
21
SSH
22
Telnet
23
DNS
53
HTTP
80
SNMP
161
Network cards!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.17!
Anthony D. Joseph
!CS162
Lec 16.18!
Administrivia"
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.19!
Page 5
Anthony D. Joseph
!CS162
Lec 16.20!
Review: Layering"
2min Break"
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.21!
Properties of Layers"
Anthony D. Joseph
!CS162
Lec 16.22!
Presentation"
Session"
Transport"
Application"
Network"
Datalink"
Physical"
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.23!
Page 6
Anthony D. Joseph
!CS162
Lec 16.24!
Datalink !
layer!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Service: !
Datalink !
layer!
Transmission !
medium!
Physical
Layer !
101010100110101110
3/31/2014!
Anthony D. Joseph
101010100110101110
!CS162
Physical
Layer !
3/31/2014!
Lec 16.25!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Anthony D. Joseph
!CS162
Datalink
Layer !
Frame
Hdr.
Physical
Layer !
101010100110101110!
3/31/2014!
Anthony D. Joseph
Frame Payload!
101010100110101110!
!CS162
Lec 16.26!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Wi-Fi MAC
address!
Network!
Layer!
Frame
Hdr.
Frame Payload!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Wired/Ethernet
MAC address!
Datalink
Layer !
Physical
Layer !
3/31/2014!
Lec 16.27!
Page 7
Anthony D. Joseph
!CS162
Lec 16.28!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
LANs"
All hosts in a LAN can share same physical
communication media!
Also called, broadcast channel!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Examples:!
!
!
B"
!
Ethernet cable and port!
B"
3/31/2014!
Anthony D. Joseph
!CS162
Switches"
Hosts in same LAN can be also connected by
switches!
A switch forwards frames only to intended recipients!
3/31/2014!
Lec 16.29!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
!CS162
Lec 16.30!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Three solutions:!
Anthony D. Joseph
Channel partition!
Taking turns!
Switch"
Random access!
B"
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.31!
Page 8
Anthony D. Joseph
!CS162
Lec 16.32!
MAC Protocols"
Channel partitioning protocols:"
Allocate 1/N bandwidth to every host !
Share channel efficiently and fairly at high load!
MAC Protocols"
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Random Access"
Efficient at low load: single node can fully utilize channel
High load: collision overhead!
Randomness"
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.33!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Anthony D. Joseph
Network
Layer !
Net.
Hdr.
Lec 16.34!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Transport!
Layer!
Net. Payload!
Net.
Hdr.
Net. Payload!
Network
Layer !
Net.
Hdr.
Net. Payload!
Datalink
Layer !
Frame Payload!
!CS162
IP Dest. Address!
IP Src. Address!
!
Transport!
Layer!
Buffer management!
!CS162
Packet scheduling/priority!
Anthony D. Joseph
3/31/2014!
Application"
Present."
Session"
Transport"
! Network"
Datalink"
Physical"
Datalink
Layer !
Frame
Hdr.
Physical
Layer !
101010100110101110!
3/31/2014!
Lec 16.35!
Page 9
Net.
Hdr.
Frame
Hdr.
Net. Payload!
Anthony D. Joseph
101010100110101110!
!CS162
Physical
Layer !
Lec 16.36!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Host A!
(IP A)!
R4!
R2!
R3!
!
R1!
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.37!
Anthony D. Joseph
!CS162
Lec 16.38!
2min Break"
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.39!
Page 10
Anthony D. Joseph
!CS162
Lec 16.40!
Routers"
Packet Forwarding"
incoming links
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
outgoing links
Memory
Host A!
(IP A)!
Host B !
(IP B)!
R4!
IP B!
R2!
R3!
R1!
3/31/2014!
Anthony D. Joseph
!CS162
Analogy
3/31/2014!
Lec 16.41!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Anthony D. Joseph
!CS162
Lec 16.42!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Analogy:!
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.43!
Page 11
Anthony D. Joseph
!CS162
Lec 16.44!
Networking Standards"
Comcast"
- Andrew Tanenbaum
OSPF: Open
Shortest
Path First"
Source: Wikipedia: Internet Connectivity Distribution & Core.svg
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.45!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
!CS162
Lec 16.46!
Application"
Present."
Session"
Transport"
Network"
Service:!
Datalink"
Provide end-to-end communication between processes! Physical"
source!
Anthony D. Joseph
destination!
IP network!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.47!
Page 12
Anthony D. Joseph
!CS162
Lec 16.48!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Port Numbers"
Port number: 16-bit number identifying the endpoint of a transport connection!
E.g., 80 identifies the port on which a processing
implementing HTTP server can be connected!
Transport
Layer !
Network
Layer !
Datalink
Layer !
Physical
Layer !
3/31/2014!
Frame
Hdr.
Trans.
Hdr.
Data!
Net.
Hdr.
Trans.
Hdr.
Data!
Net.
Hdr.
Trans.
Hdr.
Data!
Frame
Hdr.
101010100110101110!
Anthony D. Joseph
Data!
Net.
Hdr.
Trans.
Hdr.
Data!
Network
Layer !
Net.
Hdr.
Trans.
Hdr.
Data!
Datalink
Layer !
Transport
Layer !
Trans.
Hdr.
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Physical
Layer !
101010100110101110!
!CS162
3/31/2014!
Lec 16.49!
Application"
Present."
Session"
Transport"
Network"
Datalink"
Physical"
Anthony D. Joseph
!CS162
Lec 16.50!
Data!
Application
Layer
Trans.
Hdr.
Data!
Transport
Layer !
Net.
Hdr.
Trans.
Hdr.
Data!
Network
Layer !
Net.
Hdr.
Trans.
Hdr.
Data!
Datalink
Layer !
101010100110101110!
Physical
Layer !
Data!
Network
Layer !
Trans.
Hdr.
Data!
Net.
Hdr.
Trans.
Hdr.
Data!
Net.
Hdr.
Trans.
Hdr.
Data!
3/31/2014!
Anthony D. Joseph
!CS162
Datalink
Layer !
Frame
Hdr.
Physical
Layer !
101010100110101110!
3/31/2014!
Lec 16.51!
Page 13
Anthony D. Joseph
Frame
Hdr.
!CS162
Lec 16.52!
Physical Communication"
Communication goes down to physical network!
Then from network peer to peer!
Then up to relevant layer!
3/31/2014!
Application"
Transport"
Network"
Datalink"
Physical"
Host A"
Anthony D. Joseph
Network"
Datalink"
Physical"
Application"
Transport"
Network"
Datalink"
Physical"
Application"
Transport"
Network"
Datalink"
Physical"
Router"
Host B"
Host A"
!CS162
3/31/2014!
Lec 16.53!
TCP!
Ethernet!
Copper!
SONET!
Lec 16.54!
Data Link"
Physical"
Radio!
!CS162
802.11!
Fiber!
Host B"
Transport"
Waist!
IP!
Router"
Applications"
UDP!
Network"
Datalink"
Physical"
Implications of Hourglass"
Anthony D. Joseph
Application"
Transport"
Network"
Datalink"
Physical"
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.55!
Page 14
Anthony D. Joseph
!CS162
Lec 16.56!
Drawbacks of Layering"
!
3/31/2014!
Anthony D. Joseph
!CS162
3/31/2014!
Lec 16.57!
Anthony D. Joseph
!
!
!CS162
Lec 16.58!
Internet: 5 layers!
Anthony D. Joseph
Summary"
3/31/2014!
!CS162
3/31/2014!
Lec 16.59!
Page 15
Anthony D. Joseph
!CS162
Lec 16.60!