introduction to computer networks cs640 layering and protocols

48
Ming Liu mgliu@cs.wisc.edu Introduction to Computer Networks CS640 https://pages.cs.wisc.edu/~mgliu/CS640/F21/ Layering and Protocols 1

Upload: others

Post on 19-Feb-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Computer Networks CS640 Layering and Protocols

Ming Liu [email protected]

Introduction to Computer Networks

CS640 https://pages.cs.wisc.edu/~mgliu/CS640/F21/

Layering and Protocols

1

Page 2: Introduction to Computer Networks CS640 Layering and Protocols

Wireless Network Outage During Weekend

2

Page 3: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 4: Introduction to Computer Networks CS640 Layering and Protocols

Design Requirements

#1: Scalable connectivity

#2: Cost-efficient resource usage

4

#3: Support for common services

Page 5: Introduction to Computer Networks CS640 Layering and Protocols

What software functionalities the network should provide?

5

Page 6: Introduction to Computer Networks CS640 Layering and Protocols

What software functionalities the network should provide?

5

• Addressing

• Routing or forwarding

• Sharing or multiplexing

• Security • …

Page 7: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 8: Introduction to Computer Networks CS640 Layering and Protocols

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.

Page 9: Introduction to Computer Networks CS640 Layering and Protocols

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.

Page 10: Introduction to Computer Networks CS640 Layering and Protocols

Addressing and Routing

Host A

Host B

Routing: determine how to forward messages • Switches use MAC addresses • Routers use IP addresses

9

Page 11: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 12: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 13: Introduction to Computer Networks CS640 Layering and Protocols

Statistical Multiplexing

Problem: How to multiplex resources among many applications to architect a cost-effective network?

11

Page 14: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 15: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 16: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 17: Introduction to Computer Networks CS640 Layering and Protocols

Common communication services

Security • No eavesdropping, …

13

Page 18: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 19: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 20: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 21: Introduction to Computer Networks CS640 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

Page 22: Introduction to Computer Networks CS640 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

Challenge: how to come up with the right abstractions?

15

Page 23: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 24: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 25: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 26: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 27: Introduction to Computer Networks CS640 Layering and Protocols

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, …

Page 28: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 29: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 30: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 31: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 32: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 33: Introduction to Computer Networks CS640 Layering and Protocols

OSI Layers and Locations

Application

Presentation

Session

Transport

Network

Data Link

Physical

Host Hub Switch Router Host

23

Page 34: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 35: Introduction to Computer Networks CS640 Layering and Protocols

The Reality: TCP/IP Model

FTP

TCP

HTTP TFTP

UDP

Kerberos

IP

NET1 NET2 NETn

Waist

25

Page 36: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 37: Introduction to Computer Networks CS640 Layering and Protocols

TCP/IP v.s. OSI

Session

Transport

Presentation

Application

Network

Data link

Physical

Application (plus libraries)

IP

Data link

Physical

26

TCP/UDP

Page 38: Introduction to Computer Networks CS640 Layering and Protocols

TCP/IP Layering

Application

Transport

Network

Data Link

Physical

Host Hub Switch Router Host

27

Page 39: Introduction to Computer Networks CS640 Layering and Protocols

Layers & EncapsulationUser A

Get index.html

User B

28

Page 40: Introduction to Computer Networks CS640 Layering and Protocols

Layers & EncapsulationUser A

Get index.html

Connection ID

User B

Header

28

Page 41: Introduction to Computer Networks CS640 Layering and Protocols

Layers & EncapsulationUser A

Get index.html

Connection ID

Source/Destination

Link Address

User B

Header

28

Page 42: Introduction to Computer Networks CS640 Layering and Protocols

Layers & EncapsulationUser A

Get index.html

Connection ID

Source/Destination

Link Address

User B

Header

28

Page 43: Introduction to Computer Networks CS640 Layering and Protocols

Layers & EncapsulationUser A

Get index.html

Connection ID

Source/Destination

Link Address

User B

Header

28

Page 44: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 45: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 46: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 47: Introduction to Computer Networks CS640 Layering and Protocols

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

Page 48: Introduction to Computer Networks CS640 Layering and Protocols

Summary

Today • Network requirements: the software view

• Layering and protocols

Next lecture • Evaluating a network -- performance

• Socket APIs • Lab1 overview

32