Lecture 3
Lecture 3
1
Previously …
1. Network-application interfaces define how apps use
the network
– Sockets are widely used in practice
– Lets apps talk to each other via hosts; hides the details of
the network
2
Client-Server Example Using Sockets
3
Protocols and Layers
• The network does much for apps
– Make and break connections
– Find a path through the network
– Transfers information reliably
– Transfers arbitrary length information
– Send as fast as the network allows
– Shares bandwidth among users
– Secures information in transit
– Let many new hosts be added
– …
4
Protocols and Layers
• Protocols and layering is the main structuring method used to
divide up network functionality
– Each instance of a protocol talks virtually to its peer using the protocol
– Each instance of a protocol uses only the services of the lower layer
Node 1 Node 2
5
Protocols and Layers
• Set of protocols in use is called a protocol stack
6
Protocols and Layers
• Protocols you’ve probably heard of
– TCP, IP, 802.11, Ethernet, HTTP, SSL, DNS, … and
many more
Browser
7
Encapsulation
• Encapsulation is the mechanism used to effect
protocol layering
– Lower layer wraps higher layer content, adding its
own information to make a new message for delivery
• What should be added
– Protocol information
– Some functionalities may include proper data
sequencing, error detection and control, flow control,
congestion control, routing information, etc.
8
Encapsulation
• Message “on the wire” begins to look like an onion
– Lower layers are outermost
HTTP
HTTP
TCP HTTP T
TCP
IP TCP HTTPa T
IP
9
Encapsulation
802.11 IP TCP HTTPa Ta
Highest Layer
Lowest Layer
10
Encapsulation
HTTP HTTP
TCP TCP
IP IP
802.11 802.11
(wireless)
Normally draw message like this: each layer adds its own header
• Trailers
– Control information added in the end
12
De-encapsulation
TCP UDP
IP ARP
13
Advantage of Layering
• Information hiding and reuse
Browser Server Browser Server
14
Advantage of Layering
• Using information hiding to connect different systems
Browser Server
HTTP HTTP
IP IP IP IP
15
Advantage of Layering
• Using information hiding to connect different systems
Browser Server
HTTP HTTP
IP IP IP IP
16
Disadvantage of Layering
• Adds overhead
– But minor for long messages
• Hides information
– App might care whether it is running over wired or
wireless!
17
Still not know
• What functionality should we implement at
which layer?
– Key design questions
• The number of layers should be large
• The number of layers should be small
• Changes made in one layer should not need changes in
other layers.
• Each layer should provide encapsulated services to the
next higher layer
– Reference models provide frameworks that guide
us
18
OSI “7 layer” Reference Model
• A principled, international standard, to connect systems
– Influential, but not used in practice
3 Internet IP
22
A Note About Layers
• They are guidelines, not strict
– May have multiple protocols working together in
one layer
– May be difficult to assign a specific protocol to a
layer
23
Reference Model used in this Course
• Mostly follow the Internet
– A little more about the Physical layer
7 Application -Programs that use network service
4 Transport -Provides end-to-end data delivery
3 Internet -Send packets over multiple networks
2 Link -Send frames over a link
1 Physical -Send bits using signals
24
Lecture Progression
• Bottom-up through the layers
Application -HTTP, DNS, CDNs
Transport -TCP, UDP
Internet -IP, NAT, BGP
Link -Ethernet, 802.11
Physical -Wires, fiber, wireless
25
Physical Layer
• Concerns how signals are used to transfer
message bits over a link
– Wires etc. carry analog signals
– We want to send digital signals
10110… …10110
Signal
A Simple Model of “Link”
Message
Message
28
Latency Examples
• “Dialup” with a telephone modem:
– D = 5ms, R = 56 kbps, M = 1500 bytes
L = 5ms + 1500*8/56e3 = 219 ms
29