Vous êtes sur la page 1sur 21

Introduction to Computer Networks

Protocols and Layering (1.3)


David Wetherall (djw@uw.edu) Professor of Computer Science & Engineering

Networks Need Modularity


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 Lets many new hosts be added
2

CSE 461 University of Washington

Networks Need Modularity


The network does much for apps:
Make and break connections Find a need path through the of network We a form Transfers information reliably modularity, to help Transfers arbitrary length information manage complexity Send as fast as the network allows Shares bandwidth among and support reuseusers Secures information in transit Lets many new hosts be added
3

CSE 461 University of Washington

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
CSE 461 University of Washington 4

Protocols and Layers (2)

CSE 461 University of Washington

Protocols and Layers (3)


Protocols are horizontal, layers are vertical
Instance of protocol X

Protocol X Service provided by Protocol Y

Peer instance

Lower layer instance (of protocol Y)

Node 1
CSE 461 University of Washington

Node 2
6

Protocols and Layers (4)


Set of protocols in use is called a protocol stack

CSE 461 University of Washington

Protocols and Layers (5)


Protocols youve probably heard of:
TCP, IP, 802.11, Ethernet, HTTP, SSL, DNS, and many more

An example protocol stack


Used by a web browser on a host that is wirelessly connected to the Internet

CSE 461 University of Washington

Protocols and Layers (6)


Protocols youve probably heard of:
TCP, IP, 802.11, Ethernet, HTTP, SSL, DNS, and many more
Browser HTTP TCP IP 802.11

An example protocol stack


Used by a web browser on a host that is wirelessly connected to the Internet

CSE 461 University of Washington

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 Like sending a letter in an envelope; postal service doesnt look inside
CSE 461 University of Washington 10

Encapsulation (2)
HTTP TCP IP 802.11

CSE 461 University of Washington

11

Encapsulation (3)
Message on the wire begins to look like an onion
Lower layers are outermost
HTTP TCP IP 802.11 IP TCP TCP HTTP HTTP HTTP

HTTP TCP IP 802.11


12

CSE 461 University of Washington

Encapsulation (4)
HTTP TCP IP TCP
802.11 IP TCP

HTTP TCP IP 802.11


(wire)
802.11 IP TCP

HTTP TCP IP 802.11


TCP IP TCP
802.11 IP TCP

HTTP HTTP HTTP HTTP

HTTP HTTP HTTP

HTTP

CSE 461 University of Washington

13

Encapsulation (5)
Normally draw message like this:
Each layer adds its own header
802.11 IP TCP HTTP
Last bits

First bits on the wire

More involved in practice


Trailers as well as headers, encrypt/compress contents Segmentation (divide long message) and reassembly
CSE 461 University of Washington 14

Demultiplexing
Incoming message must be passed to the protocols that it uses
SMTP TCP IP HTTP UDP ARP DNS

Ethernet ??
CSE 461 University of Washington 15

Demultiplexing (2)
Done with demultiplexing keys in the headers
SMTP TCP port number IP protocol field Ethertype value TCP IP HTTP UDP ARP DNS

Host

Ethernet TCP HTTP

Incoming message

Ethernet IP
CSE 461 University of Washington

16

Advantage of Layering
Information hiding and reuse
Browser HTTP Server HTTP Browser HTTP Server HTTP

or

CSE 461 University of Washington

17

Advantage of Layering (2)


Information hiding and reuse
Browser HTTP TCP IP 802.11 Server HTTP TCP IP 802.11 Browser HTTP Server HTTP TCP IP Ethernet

or

TCP IP Ethernet

CSE 461 University of Washington

18

Advantage of Layering (3)


Using information hiding to connect different systems
Browser HTTP TCP IP 802.11 Server HTTP TCP IP Ethernet

CSE 461 University of Washington

19

Advantage of Layering (4)


Using information hiding to connect different systems
Browser HTTP TCP IP 802.11
802.11 IP TCP IP TCP HTTP

Server HTTP TCP IP 802.11


HTTP

IP Ethernet
Ethernet IP TCP

IP Ethernet
HTTP
20

CSE 461 University of Washington

Disadvantage of Layering
Adds overhead
But minor for long messages

Hides information
App might care whether it is running over wired or wireless!

CSE 461 University of Washington

21

Vous aimerez peut-être aussi