Understand the concept of layered architecture styles. Set up and implement point-to-point network communication using sockets. Explore the differences between streaming data, messages, and structured messages.
Examples
Exercises
Context
In a layered architecture style, the components are organized in a layered fashion (vansteen17). This means, they are stacked on top of each other. Typically, components are only allowed to make downcalls but there are exceptions, where a lower layer is allowed to make an upcall to a higher layer. Often, this solved by passing a handle to be called later by the lower layer.
A well-known application for the layered style are communication protocol stacks such as the Internet protocol suite. Each layer implements a service and provides an interface to the upper layers. Looking from the top, the other layers are hidden:
The Internet Protocol Suite is the set of communication protocols used to interconnect network devices on the internet, which we use every day:
Internet protocol suite - Wikipedia
As defined by RFC1122, the Internet communication layers, there are four different layers:
RFC 1122: Requirements for Internet Hosts - Communication Layers
Layer | Description | Protocols |
---|---|---|
Application | Responsible for providing services to the users such as email, file transfer, and web browsing. | HTTP, SSH, FTP |
Transport | Responsible for providing an end-to-end communication between two applications. | TCP, UDP |
Internet | Responsible for routing and forwarding of packets from a source to a destination. | IP |
Link | Responsible for providing reliable delivery of packets over a physical link. | Ethernet, Wifi |
Network sockets provide an interface between the application layer and the transport layer of the Internet protocol suite. They are used by applications to send and receive data over the network. Network sockets are used to establish communication between two or more computers, and they can be used to send data in both directions.