Hi,
As we introduced the hierarchical model in the last episode, and for each layer, it charges for the specific mission and the whole seven layers form a part responds for the packet encapsulation and decapsulation. In this episode, we are going to introduce you to the application layer and transport layer. In addition, the most commonly used protocol accordingly will be included.

Figure 1: OSI model
Application Layer
As the closest to the users, the application layer provides applications such as game center, conference center, friend center, enterprise applications, streaming, and general telecommunication services. It can also invoke the service capability of the lower layer through the API interface provided by OSA to implement various services. Besides the commonly seen application services, the application layer also bears a lot of network protocols.
BGP: The most commonly used routing protocol to spread routes between different ASs. Unlike the traditional distance-vector routing protocol, such as RIP, BGP is a path-vector routing protocol. On the other hand, due to run over the application layer, BGP could be considered as an application that spreads routes between different networks. Here comes another BGP character, BGP doesn't find the routes but spreads the routes, which means, BGP only spreads learned routes, to find the routes, we need other routing protocols, such as OSPF, ISIS.

Figure 2: BGP and OSPF
DHCP: You might hear about the DHCP, it helps to assign IP addresses, gateway, and DNS to the terminals so that saves a lot a engineers' labor.
SNMP: This is the most commonly used network management protocol. It allows administrators to view and modify the network units' running status and configuration, which centralizes the network management and reduces the human cost.
The presentation layer is responsible for the delivery and formatting of information to the application layer for further processing or display, Session layer provides the mechanism for opening, closing, and managing a session between end-user application processes, i.e., a semi-permanent dialogue. Due to these two layers are not the focus study object, so we just ignore these two layers.
Transport Layer
A transport layer provides end-to-end or host-to-host communication services for applications within a layered architecture of network components and protocols. The transport layer provides services such as connection-oriented data stream support, reliability, flow control, and multiplexing. Transport layer implementations are contained in both the TCP/IP model (RFC 1122), which is the foundation of the Internet, and the Open Systems Interconnection (OSI) model of general networking, however, the definitions of details of the transport layer are different in these models. In the Open Systems Interconnection model the transport layer is most often referred to as Layer 4 or L4. The best-known transport protocol is the Transmission Control Protocol (TCP). It lent its name to the title of the entire Internet Protocol Suite, TCP/IP. It is used for connection-oriented transmissions, whereas the connectionless User Datagram Protocol (UDP) is used for simpler messaging transmissions. TCP is the more complex protocol, due to its stateful design incorporating reliable transmission and data stream services.
TCP is a connection-oriented protocol, which means a reliable connection should be established before the data transmission. To establish a TCP session, a well-known three-hand-shake mechanism is adopted.

Figure 3: TCP 3-way handshake mechanism
To stop the TCP connection, four hand-shake is performed.

Figure 4: TCP 4-way handshake mechanism
On the contrary to TCP, UDP is a connectionless protocol. When transmitting the data, it just encapsulates the data and sends them out, no connection is required before that.

Figure 5: TCP and UDP comparison




