introduction to computer networks cs640 layering and protocols
TRANSCRIPT
Ming Liu [email protected]
Introduction to Computer Networks
CS640 https://pages.cs.wisc.edu/~mgliu/CS640/F21/
Layering and Protocols
1
Wireless Network Outage During Weekend
2
Today
Last lecture • Networks and applications • Network requirements: the hardware view
3
Today • Network requirements: the software view
• Layering and protocols
Announcements • Form your lab group by the end of this week (September 17th 11:59pm)
• Lab1 and HW1 will be released today
Design Requirements
#1: Scalable connectivity
#2: Cost-efficient resource usage
4
#3: Support for common services
What software functionalities the network should provide?
5
What software functionalities the network should provide?
5
• Addressing
• Routing or forwarding
• Sharing or multiplexing
• Security • …
Addressing and Routing
Address • Provide a way for hosts to identify and reach each other • Different network hardware elements use different addresses
Host A
Host B
6
Addressing and Routing
Host A
Host B
IP address: identifies end-point and encodes network location • 128.2.3.6 labels a node or host in a network numbered 128.2
7
Just an example. No need to understand at this time. We’ll talk about IP in details later.
Addressing and Routing
Host A
Host B
MAC address: identifies node or host alone • Does not carry any information about where the host is located in • Given by NIC vendors, e.g., 82:13:08:df:07:40 • When an endhost moves, IP could change but not MAC
8
Just an example. No need to understand at this time. We’ll talk about MAC in details later.
Addressing and Routing
Host A
Host B
Routing: determine how to forward messages • Switches use MAC addresses • Routers use IP addresses
9
Addressing and Routing
Host A
Host B
Routing: determine how to forward messages • Switches use MAC addresses • Routers use IP addresses
Destination address Forwarding port Metadata
10
Addressing and Routing
Host A
Host B
Routing: determine how to forward messages • A set of forwarding tables in each switch or router that collectively determine the path of a message through a network
Source
Destination10
Statistical Multiplexing
Problem: How to multiplex resources among many applications to architect a cost-effective network?
11
Statistical Multiplexing
Problem: How to multiplex resources among many applications to architect a cost-effective network?
Candidate solutions • TDM
• Allocate time slots to each application in a round-robin order • Apps send packets in its allocated time slots
• FDM
• Allocate capacity to each application in a round-robin order • Apps send as many packets per unit time as the capacity allows
11
Statistical Multiplexing
Problem: How to multiplex resources among many applications to architect a cost-effective network?
Candidate solutions • TDM
• Allocate time slots to each application in a round-robin order • Apps send packets in its allocated time slots
• FDM
• Allocate capacity to each application in a round-robin order • Apps send as many packets per unit time as the capacity allows
• Bandwidth is wasted if an application becomes idle • The number of application is unknown when allocation happens • Applications could enter/leave/move
11
Statistical Multiplexing
On-demand transmission with quantum throttling
Two ideas • MTU (maximum transmission unit) • Define an upper bound on the size of the block of data
• Hosts use the “Path MTU Discovery” service to find the MTU
• FIFO (first-in first-out) • Networking nodes use a buffer implementing FIFO the (first-in first-out) scheduling
• Packets from all the hosts are queued at the in-network buffer • But, congestion happens when the FIFO queues overflow
12
Common communication services
Security • No eavesdropping, …
13
Common communication services
Reliability • bit errors, packet drops, link/switch failures, in order or not, …
Communication patterns • unicast, multicast, broadcast, …
Channel types • request/reply, message streams, …
Security • No eavesdropping, …
13
Functionalities Needed from the Network
Address and routing • Basic connectivity
Statistical multiplexing • Efficient resource sharing
Common communication services • Security, Reliability, communication patterns, channel types, …
14
Functionalities Needed from the Network
Address and routing • Basic connectivity
Statistical multiplexing • Efficient resource sharing
Common communication services • Security, Reliability, communication patterns, channel types, …
14
• How do you implement these functionalities? • Key: Layering and protocols
What is Layering?
A way to deal with complexity • Add multiple levels of abstraction
• Each level encapsulates some key functionalities • And exports an interface to other components
Layering: modular approach to implementing new functionality by introducing abstractions
15
What is Layering?
A way to deal with complexity • Add multiple levels of abstraction
• Each level encapsulates some key functionalities • And exports an interface to other components
Layering: modular approach to implementing new functionality by introducing abstractions
Challenge: how to come up with the right abstractions?
15
Example of Layering
Software and hardware for communication between two hosts
Advantages • Simplify design and implementation
• Easy to modify/evolve
Link hardware
Host-to-host connectivity
Application-to-application channelsApplication semantics
16
What is a Protocol?
Could be multiple abstractions at a given level • Build on the same lower level • But provide different service to higher layers
Protocol: abstract object or module in layered structure
Link hardware
Host-to-host connectivity
Request-ReplyApplication
Message stream
17
1. Protocols Offer Interfaces
Each protocol offers interfaces • One to higher-level protocols on the same end hosts
• Expects one from the layers on which it builds • Interface characteristics, e.g., IP service model
• A “peer interface” to a counterpart on destinations • Syntax and semantics of communications • (Assumptions about) data formats
Protocols build upon each other • Adds value, improves functionality overall, e.g., a reliable protocol running on top of IP
• Reuse, avoid re-writing, e.g., OS provides TCP, so apply don’t have to rewrite
18
2. Protocols Necessary for Interoperability
Protocols are the key to interoperability • Networks are very heterogeneous • The HW/SW of communicating parties are often not build by the same vendor • Yet they can communicate because they use the same protocol • Actually implementations could be different • But must adhere to same specifications
Protocols exist at many levels • Application level protocols • Protocols at the hardware level
19
2. Protocols Necessary for Interoperability
Protocols are the key to interoperability • Networks are very heterogeneous • The HW/SW of communicating parties are often not build by the same vendor • Yet they can communicate because they use the same protocol • Actually implementations could be different • But must adhere to same specifications
Protocols exist at many levels • Application level protocols • Protocols at the hardware level
19
Link optical fiber, coaxial cable
Endhost adapter Mellanox, Intel, Broadcom
Switch/Router Cisco, Arista, Juniper, …
App Email, Web, video, …
2. Protocols Necessary for Interoperability
Protocols are the key to interoperability • Networks are very heterogeneous • The HW/SW of communicating parties are often not build by the same vendor • Yet they can communicate because they use the same protocol • Actually implementations could be different • But must adhere to same specifications
Protocols exist at many levels • Application level protocols • Protocols at the hardware level
19
OSI Model
One of the first standards for layering: OSI
Breaks up network functionality into seven layers
This is a reference model • For ease of thinking and implementation
A different model, TCP/IP, used in practice
20
The OSI Standard: 7 layers
1. Physical: transmit bits
2. Data link: collect bits into frames and transmit frames (adaptor/device deriver)
3. Network: route packets in a packet switched network
4. Transport: send messages across processes end2end
21
The OSI Standard: 7 layers (cont’d)
5. Session: tie related flows together
6. Presentation: format of app data (byte ordering, video format)
7. Application: application protocols (e.g., HTTP)
22
The OSI Standard: 7 layers (cont’d)
5. Session: tie related flows together
6. Presentation: format of app data (byte ordering, video format)
7. Application: application protocols (e.g., HTTP)• OSI is very successfully at shaping thought
• TCP/IP standard has been amazingly successful, and it’s not based on a rigid OSI model
22
OSI Layers and Locations
Application
Presentation
Session
Transport
Network
Data Link
Physical
Host Hub Switch Router Host
23
The Reality: TCP/IP Model
FTP
TCP
HTTP TFTP
UDP
Kerberos App protocols
IP
NET1 NET2 NETn
Two major transport protocols: provide logical channels to apps
Interconnection of n/w technologies into a single logical n/w
Network protocols implemented
by a combination of hw and sw
24
The Reality: TCP/IP Model
FTP
TCP
HTTP TFTP
UDP
Kerberos
IP
NET1 NET2 NETn
Waist
25
The Reality: TCP/IP Model
FTP
TCP
HTTP TFTP
UDP
Kerberos
IP
NET1 NET2 NETn
Waist
• The waist: minimal, carefully chosen functions. Facilitates interoperability and rapid evolution
25
TCP/IP v.s. OSI
Session
Transport
Presentation
Application
Network
Data link
Physical
Application (plus libraries)
IP
Data link
Physical
26
TCP/UDP
TCP/IP Layering
Application
Transport
Network
Data Link
Physical
Host Hub Switch Router Host
27
Layers & EncapsulationUser A
Get index.html
User B
28
Layers & EncapsulationUser A
Get index.html
Connection ID
User B
Header
28
Layers & EncapsulationUser A
Get index.html
Connection ID
Source/Destination
Link Address
User B
Header
28
Layers & EncapsulationUser A
Get index.html
Connection ID
Source/Destination
Link Address
User B
Header
28
Layers & EncapsulationUser A
Get index.html
Connection ID
Source/Destination
Link Address
User B
Header
28
Protocol Demultiplexing
Multiple choice at each layer
How to know which one to pick?
FTP
TCP
HTTP TFTP
UDP
Kerberos
IP
NET1 NET2 NETn
29
Multiplexing & Demultiplexing
Multiplex implementations of each layer • How does the receiver know what version/module of a layer to use
Packet header includes a demultiplexing field • Used to identify the right module for next layer • Filled in by sender • Used by the receiver
Multiplexing occurs at multiple layers • E.g., IP, TCP
30
Multiplexing & Demultiplexing
Multiplex implementations of each layer • How does the receiver know what version/module of a layer to use
Packet header includes a demultiplexing field • Used to identify the right module for next layer • Filed in by sender • Used by the receiver
Multiplexing occurs at multiple layers • E.g., IP, TCP
30
Layering v.s. Not
Layer N may duplicate layer N-1 functionality • E.g., error recovery
Layers may need same info (timestamp, MTU)
Some layers are not always cleanly separated • Inter-layer dependencies in implementation for performance reasons • Many cross-layer assumptions, e.g. buffer management
Layer interfaces are not really standardized • It would be hard to mix and match layers from independent implementations
31
Summary
Today • Network requirements: the software view
• Layering and protocols
Next lecture • Evaluating a network -- performance
• Socket APIs • Lab1 overview
32