Presentation is loading. Please wait.

Presentation is loading. Please wait.

Layered Communication Layers work together Encapsulation and Deencapsulation.

Similar presentations


Presentation on theme: "Layered Communication Layers work together Encapsulation and Deencapsulation."— Presentation transcript:

1 Layered Communication Layers work together Encapsulation and Deencapsulation

2 Indirect Communication Application programs on different machines cannot communicate directly –They are on different machines! Browser Trans Int DL Phy User PC Web App Trans Int DL Phy Webserver HTTP Request

3 Layer Cooperation on the Source Host Application layer process passes HTTP- request to transport layer process Application Transport Internet Data Link HTTP Request PhysicalUser PC

4 Layer Cooperation on the Source Host Transport layer makes TCP segments –HTTP message is the data field –Adds TCP header fields shown earlier –Transport process “encapsulates” HTTP request within a TCP segment HTTP Request TCP-H TCP Segment Data Field TCP Header

5 Encapsulation Encapsulation is delivering a message in the data field of another message –TCP encapsulates HTTP request messages –Can also encapsulate other types of messages HTTP Request TCP-H TCP Segment Data Field TCP Header

6 Layer Cooperation on the Source Host Transport layer process passes the TCP segment down to the internet layer process Application Transport Internet Data Link TCP segment PhysicalUser PC

7 Layer Cooperation on the Source Host Internet Layer Process Encapsulates TCP Segment within an IP packet –An IP packet to deliver a TCP segment has a TCP segment in its data field TCP segment IP-H Data IP Packet Data Field IP Header

8 Layer Cooperation on the Source Host The internet layer process passes the IP packet to the data link layer process –Internet layer messages are called packets Application Transport Internet Data Link IP packet PhysicalUser PC

9 Layer Cooperation on the Source Host Data Link Layer Encapsulates IP Packet Within a PPP Frame –Data link layer messages are called frames –Data PPP frame has IP packet in data field PPP Frame Encapsulating an IP Packet PPP-T IP packet PPP-H

10 Layer Cooperation on the Source Host The data link layer process passes the PPP frame to the physical layer process, which delivers it to the physical layer process on the first router, one bit at a time (no message at the physical layer) Application Transport Internet Data Link Physical (10110 …)User PC PPP frame To first router

11 PPP-T Layer Cooperation on the Source Host Recap: Adding Headers and Trailers: Application Transport Internet Data Link HTTP msg PhysicalUser PC HTTP msg TCP-H HTTP msg TCP-H IP-H HTTP msg TCP-H IP-H PPP-H

12 Layer Cooperation on the Source Host Encapsulation in Layering –Whenever a process at Layer N (the application, transport, internet, or data link layer) creates a message, –That Layer N process passes the message down to the next-lower-layer process, the process at layer N- 1 –The N-1 process encapsulates the Layer N message by placing it in the data field of a Layer N-1 message and adding headers and perhaps trailers to create the full Layer N-1 Message

13 Layer Cooperation on the Source Host Small but important detail on naming Layer 3 (internet) messages are called packets –IP message is a packet Layer 2 (data link) messages are called frames –PPP message is called a frame

14 Layer Cooperation: Destination Host Destination host reverses processes on the sending host –Delivers HTTP message to the webserver application program Application Transport Internet Data Link PhysicalUser PCWebserver

15 Layer Cooperation: Destination Host Successively pass up layer messages Application Transport Internet Data Link IP-Packet DL-Frame (protocol unknown) containing IP packet in data field DL-Frame (protocol unknown) containing IP packet in data field PhysicalFinal RouterWebserver Data link layer program processes the data link frame’s header and trailer, deencapsulates the IP packet, and passes the IP packet to the next higher layer, the internet layer

16 Layer Cooperation: Destination Host Successively pass up layer messages –Other layers pass successive data fields (containing next-layer messages) up to the next higher layer Application Transport Internet Data Link HTTP msg TCP segment IP-Packet DL-Frame (protocol unknown) PhysicalFinal RouterWebserver

17 Layer Cooperation: Destination Host Successively pass up layer messages –Other layers process headers & trailers, pass up message in data field Application Transport Internet Data Link PhysicalFinal RouterWebserver PPP-T HTTP msg HTTP seg TCP-H HTTP msg TCP-H IP-H HTTP msg TCP-H IP-H PPP-H IP Packet TCP segment HTTP msg

18 Indirect Communication Two processes on different machines cannot communicate directly with one another because they are physically separated So they communicate indirectly, using cooperation with lower layers

19 The First Router First router receives an IP packet (encapsulated in a frame) in one port (interface) Must make a router forwarding decision: select the port to use to send it back out B? D? C? Router A B C D Packet

20 Layer Cooperation on the First Router So far, we have only looked at hosts –But deencapsulation and encapsulation also occur on EACH router Frame arrives at a port on the first router –Port’s data link layer process receives the PPP frame containing an IP packet Data Link Internet PPP Frame First Router

21 Layer Cooperation on the First Router Incoming Data Link Process on the Router –Deencapsulates the IP packet from the PPP frame –Passes the IP packet to the router’ internet layer process Data Link Internet IP Packet First Router Incoming Port on First Router

22 Layer Cooperation on the First Router Routers only have physical, data link, and internet layer processes –So internet layer process is the highest-layer process on a router for router forwarding –Internet layer process decides where to send the packet next: another router or the destination host Data Link Internet First Router

23 Layer Cooperation on the First Router Internet layer process passes IP packet to data link layer process on the selected output port that will carry the IP packet to the next router or the destination host Data Link Internet First Router IP Packet Selected Output Port on First Router

24 Layer Cooperation on the First Router The data link and physical layer process on the selected port sends the frame encapsulating the IP packet onto the next router (or destination host) Internet Data Link Internet Data Link Frame Selected Output Port On First Router Input Port On Next Router (Or Destination Host) Physical Layer

25 Layer Cooperation on the First Router Notes For router forwarding, routers only use physical, data link, and internet processes Routers First Receive Frames –Receiving interface deencapsulates the IP packet, passes the packet to the internet layer process Routers Then Send Frames Out –On a different output interface (port) –This requires encapsulating of the IP packet in a data link layer frame


Download ppt "Layered Communication Layers work together Encapsulation and Deencapsulation."

Similar presentations


Ads by Google