OSI Layer Reference Model (OLRM)


OLRM:   SOLD       




OSI is the Open System Interconnection communication reference. The OSI model is used as a reference point for discussing protocol specifications.

*If you feel that you can understand this material, please test your abilities by playing the OSI Model Game in the material  GETTING TO KNOW COMPUTER NETWORK PROTOCOLS


OSI Reference Model

Substance:

  1. Layers in OSI
  2. Layer Concept and Use
  3. Application Layer
  4. Presentation Layer
  5. Session Layer
  6. Transport Layer
  7. Network Layer
  8. Data Link Layer
  9. Interaction between layers in OSI
  10. Encapsulation Data
  11. OSI and TCP/IP reference models

1. Layers in OSI

The OSI model consists of 7 layers. Where the upper part of the layer (layer 7, 6, and 5) is focused on the form of service from an application. While the lower layer (layer 4, 3, 2 and 1) is oriented towards the flow of data from one end to the other.

OSI Reference Model Table

| Nama Layer           | Fungsi                                                                                                                                                                                                               | Contoh                                                                |
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| Aplikasi (layer 7)   | Aplikasi yang saling berkomunikasi antar komputer. Aplikasi layer mengacu pada pelayanan komunikasi pada suatu aplikasi.                                                                                             | Telnet, HTTP, FTP, WWW Browser, NFS, SMTP, SNMP                       |
| Presentasi (Layer 6) | Pada layer bertujuan untuk mendefinisikan format data, seperti ASCII text, binary dan JPEG.                                                                                                                          | JPEG, ASCII, TIFF, GIF, MPEG, MIDI                                    |
| Sesi (Layer 5)       | Sesi layer mendefinisikan bagaimana memulai, mengontrol dan mengakhiri suatu percakapan (biasa disebut session)                                                                                                      | RPC, SQL, NFS, SCP                                                    |
| Transport (Layer 4)  | Pada layer 4 ini bisa dipilih apakah menggunakan protokol yang mendukung errorrecovery atau tidak. Melakukan multiplexing terhadap data yang datang, mengurutkan data yang datang apabila datangnya tidak berurutan. | TCP, UDP, SPX                                                         |
| Network (Layer 3)    | Layer ini mendefinisikan pengiriman data dari ujung ke ujung. Untuk melakukan pengiriman pada layer ini juga melakukan pengalamatan. Mendifinisikan pengiriman jalur (routing).                                      | IP, IPX, Appletalk DDP                                                |
| Data Link (layer 2)  | Layer ini mengatur pengiriman data dari interface yang berbeda. Semisal pengiriman data dari ethernet 802.3 menuju ke High-level Data Link Control (HDLC), pengiriman data WAN.                                      | IEEE 802.2/802.3, HDLC, Frame relay, PPP, FDDI, ATM                   |
| Physical (Layer 1)   | Layer ini mengatur tentang bentuk interface yang berbeda-beda dari sebuah media transmisi. Spesifikasi yang berbeda misal konektor, pin, penggunaan pin, arus listrik yang lewat, encoding, sumber cahaya dll.       | EIA/TIA-232, V35, EIA/TIA- 449, V.24, RJ45, Ethernet, NRZI, NRZ, B8ZS |

2. Concept and Use of Layers

There are many benefits to be gained from dividing functions into smaller ones or layers. The obvious benefit is reducing complexity, so that they can be defined in more detail.

Examples of uses include:

  • Humans can discuss and learn about protocols in detail.
  • Making the device into a modular form, so that users can use only the modules they need.
  • Creating an interconnected environment
  • Reduces complexity in programming, making production easier
  • Each layer can be given an opener and a closer according to the layer.
  • To communicate, you can immediately use the layer below.

3. Application Layer

This layer deals with computer programs used by the user. Computer programs that are related are only programs that perform network access, but if not, it does not relate to OSI.

Example: Word processing application, this application is used for text processing so this program is not related to OSI. But if the program is added with network functions such as sending email, then the new layer application is related here.


Application Layer

4. Presentation Layer

This layer is responsible for managing data formats that can be understood by various media. In addition, this layer can also convert data formats, so that the next layer can understand the format needed for communication, including Encryption-Description.

Examples of data formats supported by the presentation layer include: Text, Data, Graphic, Visual Image, Sound, Video. Can be described as in the image below:


Data format on the presentation layer

5. Session Layer

The session layer defines how to start, control and end a conversation (often called a session). Examples of session layers: NFS, SQL, RPC, ASP, SCP.


The Session Layer coordinates various applications when interacting between computers.

6. Transport Layer

In this layer 4, you can choose whether to use a protocol that supports error recovery or not. Multiplexing incoming data, sorting incoming data if it is not sequential. In this layer, end-to-end communication is also arranged in several ways, so that data matters are greatly influenced by this layer 4.


Transport layer function

Functions provided by the transport layer:

  • Segmenting the top layer
  • Making an end-to-end connection
  • Sending segments from one host to another host
  • Ensuring data reliability

Segmenting the top layer

By using the OSI model, various types of different applications can be sent on the same type of transport. The transport sent is in the form of segments. So that data is sent based on first-come first served.


Segmentation on the transport layer

Making an end-to-end connection

The concept is that for a device to communicate with another device, the target device must accept the connection first before sending or receiving data.

The process carried out before sending data, as in Figure 2.6:

  • The sender sends a Synchronize signal first to the destination.
  • The receiver sends a reply with the Negotiate Connection signal.
  • The recipient sends a re-Synchronize, is it true that the sender will send the data?
  • The sender replies with an Acknowledge signal which means it is ready to send data.
  • Connection established
  • Then the segment is sent


Connection formation process

Sending segments from one host to another host

The delivery process that occurs in the transport layer is in the form of segments, while in the lower layer it is in the form of packets and in layer 2 it is in the form of frames and is changed into bit delivery in layer 1. This can be seen in the following image:


Transmission of segments, packets, frames, and bits

Ensuring data reliability

When data transmission is in progress, line congestion can occur. The reasons for congestion include: high-speed computers sending data faster than their network, if several computers send data to the same destination simultaneously.

To overcome this, each device is equipped with something called flow control. Where if there is a sender who sends too much data, then the recipient will send a message to the sender not to send any more data, because the previous data is being processed. And when it has been processed, the recipient will send a message to the sender to continue sending data. An illustration of flow control can be seen in the following image:


Flow Control

It is called reliable data, meaning that data packets arrive in the order in which they were sent. The protocol will fail if a packet is lost, damaged, duplicated, or receives a data packet in a different order. To ensure that the data is sent, the recipient must send an acknowledgement for each data received on the segment.

Example: The sender sends data with a window segment format of 1, then the recipient will send acknowledgement no. 2. If the sender sends data with a window segment format of 3, then the recipient will send acknowledgement no. 4 if the data is received correctly. You can see the illustration in the following image:


Windowing system

The data confirmation technique with acknowledge works by sending information about which data is in error. The image below explains that if data no.5 is damaged, the recipient will give an acknowledgement to the sender no.5, and the sender will resend the data segment no.5.


Acknowledge

7. Network Layer

The main function of the network layer is addressing and routing. Addressing on the network layer is logical addressing, an example of the use of IP addresses is shown in the image below:


Logical and physical addressing

Routing is used to direct the path of data packets to be sent. Where routing has 2 types, namely Routed and Routing Protocol.


To go to another destination using Routing

8. Data Link Layer

The functions provided in the data link layer include:

  • Arbitration, physical media selection
  • Addressing, physical addressing
  • Error detection, determines whether the data has been successfully sent.
  • Identify Data Encapsulation, determines the header pattern on data

Arbitration

Determining the right time to send data when a media is already in use, this requires a carrier signal detection. Ethernet uses the Carrier Sense Multiple Access / Collision Detection (CSMA / CD) method.


CSMA/CD

On a network that can perform simultaneous access. So if Host A sends data to Host D, then Host B and C will perform path detection, and if the path is being used then Host B and C will wait first. This can prevent collisions. The illustration is shown in the image below:


Collision

Addressing

Addressing performed on the data link layer is physical, namely using Media Access Control (MAC). MAC is embedded in the interface of a network device. MAC is 48bit in size with 12 hexadecimal format.


Media Access Control (MAC)

Error Detection

The techniques used are Frame Check Sequence (FCS) and Cyclic Redundancy Check (CRC).

Identify Data Encapsulation

Identify the format of the data passing through, whether it is Ethernet, Token Ring, Frame Relay, etc.

Encoding Protocol Type Table

| Protokol Data Link              | Bagian (Field)      | Header             | Ukuran      |
|---------------------------------|---------------------|--------------------|-------------|
| 802.3 Ethernet 802.5 Token Ring | DSAP                | Header 802.2       | 1 byte      |
| 802.3 Ethernet 802.5 Token Ring | SSAP                | Header 802.2       | 1 byte      |
| 802.3 Ethernet 802.5 Token Ring | Protocol Type       | Header SNAP        | 2 byte      |
| Ethernet (DIX)                  | Ethertype           | Header Ethernet    | 2 byte      |
| HDLC                            | Cisco proprietary   | Extra Cisco Header | 2 byte      |
| Frame Relay RFC 2427            | NLPID               | RFC1490            | 1 byte      |
| Frame Relay RFC 2427            | L2 / L3 protocol ID | Q.933              | 2 byte / ID |
| Frame Relay RFC 2427            | SNAP Protocol Type  | Header SNAP        | 2 byte      |

9. Interaction between layers in OSI

The process of how computers interact using layers in the OSI, has two general functions, including:

  • Each layer provides services to the layer above it according to its protocol specifications.
  • Each layer sends communication information through the same software and hardware between computers.


Communication between Computers on the OSI Layer

A data is created by an application on host A, for example someone writes an email. At each layer a header is added and continued to the next layer (step 1). For example: the transport layer channels the data and the header it adds to the network layer, while the network layer adds a destination address header so that the data can reach its destination computer.

After the application loads the data, the software and hardware on the computer add their headers and trailers. The physical layer can use its media to send signals for transmission (step 2).

On the receiving side (step 3), Host B begins to organize the interaction between layers on host B. The upward arrow (step 4) shows the process of breaking down the header and trailer so that the data can finally be received by the user on host B.

If the communication that occurs between 2 computers still has to go through a certain media, such as a router. Then the form of OSI layer interaction can be seen in the image below:


OSI Layer interaction in communication through an intermediary, for example a router

10. Data Encapsulation

The concept of placing data behind a header and trailer for each layer is called encapsulation. In Figure 2.16, it can be seen that each layer is given an additional header, then another header is added to the next layer, while in layer 2, in addition to adding a header, a trailer is also added. Layer 1 does not use a header and trailer.

In layer 5, 6 and 7 processing sometimes no header is needed. This is because there is no new information that needs to be processed. So for these layers it can be considered 1 process.

So the steps to carry out data encapsulation can be described as follows:

  • Step 1 Create data -- meaning an application has data to send.
  • Step 2 Packet the data for transport -- meaning the transport layer adds a header and inserts the data behind the header. In this process, the L4PDU is formed.
  • Step 3 Add the network layer destination address to the data -- the network layer creates a network header, which also contains the network layer address, and places the L4PDU behind it. This creates the L3PDU.
  • Step 4 Add the data link layer destination address to the data -- the data link layer creates a header and places the L3PDU behind it, then adds a trailer after it. This creates the L2PDU.
  • Step 5 Transmit in bit form -- at the physical layer, encode the signal and then send the frame.

So the processing will be similar to the TCP/IP model. In each layer there is an LxPDU (Layer N Protocol Data Unit), which is a form of bytes in the header-trailer in the data. In each layer a new formation is also formed, in layer 2 PDU including headers and trailers is called a frame formation. In layer 3 it is called a packet or sometimes a datagram. While in layer 4 it is called a segment. So it can be described in the following image:


Frames, Packages and Segments

So, in the example of sending an email, the encapsulation process that occurs can be illustrated as in the following image:


Encapsulation process in sending E-Mail

11. OSI and TCP/IP reference models

When compared between the OSI model and the TCP/IP model it can be described as follows:


Comparison of OSI and TCP/IP models

Comparison of Computer Network Models

This chapter contains information about various types of network devices that can be passed through the TCP/IP protocol, as well as the transmission media used and the distribution devices.

Figure 1 Internetworking (WAN, MAN, LAN)
Figure 1 Internetworking (WAN, MAN, LAN)

Figure 2 Comparison of Computer Networks
Figure 2 Comparison of Computer Networks

Understanding the Transport Layer in OSI

The transport layer is not just another type of layer. The transport layer is the heart of the entire protocol hierarchy. Its job is to provide cost-effective and reliable transport of data from a source machine to a destination machine, regardless of the physical network or networks in use at the time. Without the transport layer, the whole concept of layered protocols would have little meaning.


OSI Architecture

1. Protocol Transport Service 

The transport layer is the 4th layer of the OSI network reference model. The transport layer is responsible for providing reliable services to the protocols above it. The services in question include: 

  • Flow control to ensure that the device transmitting data does not send more data than the device receiving it can handle. 
  • Packet sequencing, which is done to change the data to be sent into data segments (this process is called the segmentation process), and of course has a feature to reassemble it. 
  • Error handling and acknowledgment features to ensure that data has been sent correctly and will be sent again when data does not reach its destination.
  • Multiplexing, which can be used to combine data from multiple sources to send it over a single data path.
  • The formation of a virtual circuit, which is done in order to create a connection session between two nodes that want to communicate. Examples of protocols that work on the transport layer are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) which are available from the TCP/IP protocol suite.


Fig. 7 layers of the OSI model 

Services in the transport layer are identical to the network layer, where there are two methods, namely Connection Oriented and Connectionless, but the transport code is run on the user's machine, while the network layer is on the router (which is operated by the connection service provider), the transport layer covers deficiencies in the network layer such as packet loss or router crash.

A distinction is made between OSI layers, where layers 1-4 are part of the transport service provider, while layers above 4 are part of the transport service user. This distinction greatly influences the layer design and places the transport layer in a very important position, because it forms the main boundary between the provider and user of reliable data transmission services.

a. Transport Layer Services to Session Layer 

The ultimate goal of the transport layer is to provide efficient, reliable, and cost-effective service to its users, usually entities such as processes in the session layer. To achieve this goal, the transport layer must use the services provided by the network layer. The hardware or software in the transport layer that does the work or uses the services is called a transport entity.

The relationship between the network layer, transport layer and session layer is shown in Figure 2.


Fig.2 Relationship between Transport Layer, Session Layer and Network Layer.

As we know that there are two types of network services, then there are also two types of transport services, namely connection-oriented and connectionless. Connection-oriented transport services are the same as connection-oriented network services in some ways. For both cases, each connection has 3 phases, namely establishment, data transfer, and release. Addressing and flow control in both layers are also the same. In addition, connectionless transport services are also the same as connectionless network services.

So there is a question: "if the transport layer services are the same as the network layer services, why should there be two different layers? Why is one layer not enough?" The answer is because the network layer is part of the communication subnet and is run by the carrier (at least for WANs). What would happen if the network layer offered connection-oriented services, but the nature of the service was unreliable? For example, it always lost packets? What would happen if it collided or issued (generated) N-RESET all the time?

Since users do not have control over the subnet, they cannot solve the problem of poor service by using better IMPs or by performing error handling in the data link layer, so the only way to improve the quality of service is to place another layer on top of the network layer. If only part of a long transmission from a transport entity is informed that its network connection has been terminated, with no indication of what has happened to the data in transit, then the transport entity can set up a new network connection to the remote transport entity. Using this new network connection, it can send queries asking which data has arrived and which has not to its peer (its counterpart), and then pick it up from where it left.

In essence, the existence of the transport layer allows the transport service to be more reliable than the underlying network service. Lost packets, corrupted data, and even network N-RESETs can be detected and replaced by the transport layer. In addition, transport service primitives can be designed to be independent of network service primitives, which vary widely from network to network (for example, connectionless LAN services can be more different than connection-oriented WAN services).

With the transport layer, we can write or create application programs using a standard set of primitives, and these programs will be able to work on various types of networks, so we don't have to worry about their relationship with different subnet interfaces and unreliable transmissions. If all real networks had no weaknesses and all had the same service primitives, then maybe we wouldn't need the transport layer. However, in reality, there is a problem with the basic function of isolating the layers above from the technology, design and imperfections of the subnet.

Therefore, many people have made a distinction between layers 1 through 4 on the one hand, and layers 5 through 7 on the other. The lower four layers can be viewed as Transport Service Providers, while the upper three layers are Transport Service Users. Assuming that they are providers and users has a major impact on the design of the layers, and places the transport layer in a key position, because it forms the primary boundary between providers and users of reliable data transmission services.

b. Quality Service 

Another way to look at the transport layer is to appreciate its primary function of improving the QOS (Quality of Service) provided by the network layer. If the network service is flawless, then the transport layer has an easy task. However, if the network service is poor, the transport layer must bridge the gap between what the transport user wants and what the network layer provides.

Although at first glance quality of service may seem like a vague concept (getting everyone to agree on what "good" service is is no easy task), it can be characterized by a number of parameters. OSI transport services allow users to specify desired, acceptable, and unacceptable values ​​for some of these parameters at the time of connection establishment. Some parameters also apply to connectionless transport. The parameters are checked by the transport layer, and determining whether it can provide the requested service depends on the type of network service it is capable of providing.


Fig.3 Transport layer quality of service parameters. 

Connection Establishment Delay (connection establishment delay) is the amount of time wasted between the time a transport connection is requested to be established and the time the user of the transport service receives confirmation. It includes processing delays in the remote transport entity. If all parameters measure or calculate delay, then the shorter the delay, the better the service.

Connection Establishment Failure Probability is the chance that a connection cannot be established within the maximum establishment delay time, for example, due to network congestion, lack of table space, or other internal problems.

The Throughput parameter measures the number of bytes of user data transferred per second, measured over some time interval at that time. Throughput is measured separately for each direction. Actually, there are two types of throughput, namely the actual measured throughput and the throughput that the network cannot provide. The actual throughput may be lower than the network capacity, because the user has not sent data as fast as the network can receive it.

Transit Delay measures the time between the sending of a message by a transport user on the source machine and its receiving by a transport user on the destination machine. As with throughput, each direction is handled separately.

The residual error rate measures the number of lost or corrupted messages as a proportion of the total messages sent in a sampling period. In theory, the residual error rate should be zero, since hiding all network layer errors is the job of the transport layer. In practice, the residual error rate may be finite (small).

Transfer Failure Probability measures the extent to which a transport service performs as expected. When a transport connection is established, the throughput, transit delay, and residual error rate must be agreed upon. The transfer failure probability provides a time window during which these agreed objectives will not be met during the observation period.

Connection Release Delay (connection release delay) is the amount of time elapsed between the time the transport user initiates a connection release and the actual release occurs at the other end.

Connection Release Failure Probability (connection release failure probability) is the proportion of connection release attempts that are not completed within the specified connection release delay interval (time period).

The Protection parameter provides a way for the transport user to specify whether he will ask his transport layer to provide protection against unauthorized third parties (wiretappers) or whether he prefers to modify the transmitted data.

The Priority parameter provides a way for transport users to indicate that some of their connections are more important than others, and in the event of congestion, to ensure that high-priority connections are served before low-priority connections.

The Resilience parameter gives the transport layer the opportunity or probability to stop spontaneously due to internal problems or congestion.

2. Transport Protocol Elements 


Fig.4 Transport protocol elements and their relationships to the five OSI connection-oriented transport protocol groups. 

Transport Protocol Elements 

The facilities provided by a transport protocol depend on the environment in which it operates (e.g., the type of network services available) and on the type of service it must provide. However, we can mention some basic elements that are common to transport protocols. Figure 4 lists these elements, and further shows which facilities are applicable to each of the five OSI protocol families. The list should not be taken too literally, because the details of the facilities sometimes differ between different protocol families, and not all alternatives and variants are listed.

All connection-oriented protocols must provide a mechanism for establishing connections. Furthermore, they must provide a way for the called party to accept or reject a requested connection.

In order to actually move bits across a network, a transport entity must establish a network connection, and maintain (track) a mapping between the transport connection and the network connection. However, a transport entity can also use a connectionless network protocol to transport data, provided that the transport protocol is a group 4 protocol (or a non-OSI protocol that has the same functionality).

Terminology 

When discussing the data link layer, we refer to the units exchanged as "fames." In the network layer, we call them "packets." Both terms are widely used (for example, in recommendation CCITTX.25). For "transport packet," there is no equivalent term, so we will use the OSI term TPDU (Transport Protocol Data Unit). We will refer to the item of information sent by the transport user to the transport provider as a message, since the OSI term TSDU (Transport Service Data Unit) is rarely used. In some cases, the distinction between a message and a TPDU is not important; when it is important, we will use the term that is more appropriate in the context.

The message to be transmitted can be of any length, so it is up to the transport layer to break the message into several TPDUs for transport. If the TPDUs do not fit into a single packet, then each TPDU may also have to be broken down (separated) further. One of the tasks of the five classes of OSI protocols is to break long messages into TPDUs that are of a size that can be used by the protocol, and then reassemble these parts (TPDUs) transparently at the other end.

If multiple connections are open on a machine, then the transport entity must assign a number to each of these connections, and place the connection number on each TPDU, so that when the TPDU arrives at the other end, the receiving transport entity knows which connection to connect to. This does not mean that transport TPDUs are a feature of all transport protocols.

The usual release of a connection is also found in all protocols, although it is done slightly differently in group 0 protocols. In this class, there is always a one-to-one mapping between the transport connection and the network connection. The transport connection is released implicitly by simply releasing the underlying network. In some other classes, the release is explicit, by exchanging control TPDUs.

All protocols must correct protocol errors. If an invalid TPDU arrives, there must be a rule that dictates what to do. In some cases, the action may be to ignore the error; in other cases, we may need to drop some (or all) connections. Protocol errors are certainly undesirable, but we must not allow transport entities to collide again if they have already occurred.

The remaining items in the list do not apply to any of the five OSI protocol families. For example, TPDU concatenation applies only to families 1 through 4, not to family 0. This facility allows the transport entity to assemble several TPDUs and then send them together as a single packet, thus reducing the number of calls to the network layer. 

Error release refers to the fact that for protocol groups 0 and 2, NRESET and N-DISCONNECT terminate the transport connection using the network connection, no attempt is made to restore it.

TPDU numbering is used to maintain (monitor) the TPDU path, by assigning consecutive TPDUs on a connection whose sequence numbers are in order from low to high, we can perform explicit acknowledgement and flow control, and there will be a way to find which TPDU was received last after an N-RESET. Group 0 (and possibly group 2) do not use sequence numbers.

Expedited data transfer is possible in the upper four protocol groups, but this is not possible in group 0.

Transport layer flow control contains the explicit part of the transport protocol that deals with the number of TPDUs that can be sent at any given time. A sliding window scheme can be used, but there are other possibilities. If no explicit flow control scheme can be used at the transport layer, we can use the basic flow control of the network connection.

Resynchronization after N-RESET is performed in groups 1, 3, and 4, this is to allow each side to find out which TPDUs it sent have arrived. Closely related to resynchronization is the need for the transport entity to retain copies of the TPDUs it sent until they are acknowledged so that they can be retransmitted after N-RESET, since groups 0 and 2 provide error release after N-RESET, rather than attempting to resynchronize, they do not need to handle retention until they are acknowledged.

3. Simple Transport Protocol 

Simple transport protocol is part of the transport layer. The primitive services included in it are the 'connection oriented' model, which is similar to TCP but simpler.

Example of Service Primitives 

5 primitives: CONNECT, LISTEN, DISCONNECT, SEND and RECEIVE - Each primitive is associated with a library procedure that executes it.

The parameters for primitives and libraries are as follows: 

  1. Connum= LISTEN(local) 
  2. Connum= CONNECT(local, remote) 
  3. Status = SEND(connum, buffer, bytes) 
  4. Status = RECEIVE(connum, buffer, bytes) 
  5. Status = DISCONNECT(connum)


Fig.5 Service Primitives: Simple client-server 

Primitives 

  1. LISTEN: announces the caller's desire (procedure call) to accept a connection request to a specific local TSAP. 
  2. CONNECT: tries to establish a transport connection between the local TSAP and the remote TSAP (on the other side). If successful connum > 0 indicates the connection identifier. If failed connum < 0 indicates the cause of the failure. For example, the remote TSAP is already connected to another TSAP. 
  3. SEND: sends the contents of the buffer as a message in the transport connection connum. Possible errors/failures are returned in the status, for example: no connection, illegal buffer address, or negative count. 
  4. RECEIVE: caller's desire to receive data. 
  5. DISCONNECT: terminate transport connection indicated by connum. If successful status = 0. Possible error: invalid connum

Transport Entity Example 

Using reliable connection-oriented services (from the network layer)

Focus on transport issues that do not appear in the lower layers 

  • Connection establishment 
  • Connection release 
  • Credit management

The transport entity can be part of the host OS, or it can be a library package that runs in the user address space.

Interface to the network layer via to_net and from_net procedures

It has 6 parameters: 

  1. Connection identifier 
  2. Bit Q (control message) 
  3. Bit M (more data follows) 
  4. Packet type 
  5. Pointer to data 
  6. Data size (number of bytes)

Each connection will be in one of 7 states: 

  1. IDLE: no connection 
  2. WAITING: CONNECT has been executed and CALL REQUEST has been sent 
  3. QUEUED: CALL REQUEST has arrived, no LISTEN yet 
  4. ESTABLISHED: connection established 
  5. SENDING: user is waiting to send a packet 
  6. RECEIVING: A RECEIVE has been made 
  7. DISCONNECTING: A DISCONNECT has been performed locally - Status changes occur for 3 reasons: 
  8. Execution of a primitive 
  9. Package arrived 
  10. Time expires - Type procedure: 
  11. Callable by user program 
  12. Spontaneous triggered by external events: packet_arrival, clock

Here I will share a presentation module about the scope of the transport layer in the 7 layers of the OSI model, which includes several things including; transport layer services, transport protocol elements and simple transport protocols. Hopefully useful.

DOWNLOAD FILE *PPT

Reference

In this chapter, we will explain the functions of 2 important protocols on the transport layer, namely:

  1. User Datagram Protocol (UDP)
  2. Transmission Control Protocol (TCP)


OSI Layer Encapsulation

1. Ports and Sockets

Port

Ports are used to perform communication processes with other processes on a TCP/IP network. Ports use 16-bit numbers, used for host-to-host communication. There are 2 types of ports, namely:

  • Well-known: port that is already owned by the server. Example: telnet uses port 23. Well-known ports have a range from 1 to 1023. Well-known ports are regulated by the Internet Assigned Number Authority (IANA) and can be used by system processes with certain users who have access.
  • Ephemeral: clients do not use well-known ports because to communicate with the server, they have already made an agreement in advance to use which port. Ephemeral ports have a range from 1023 to 65535.

For 1 port number cannot be used by 2 different applications at the same time.

Socket

The socket interface is part of the Application Programming Interface (API) which is used for communication protocols.

Terminology used:

  • Socket is a special type of file handle, which is used by the operating system to access the network.
  • The socket address is: example:
  • Conversation: communication link between 2 processes
  • Association: a communication event between 2 processes. Example:
  • Half-association : < protocol, local-address, local-process> or
  • Half-association is also called transport address.

2. User Datagram Protocol (UDP)

UDP is a protocol standard with STD number 6. The UDP specification can be seen in RFC 768 -- User Datagram Protocol.

UDP is basically an interface for IP applications. Where UDP does not have the function of data reliability, flow control, and error-recovery for IP communication. UDP has a process such as multiplexing/demultiplexing to send datagrams, from ports to IP datagrams. Therefore UDP is also called a connectionless-oriented protocol.


Port-based Demultiplexing Process in UDP

UDP Datagram Format

UDP datagram has 16 bytes as shown in the image below:


UDP Datagram Format

Where:

  • Source Port: the port used to send data.
  • Destination Port: the port used for data destination.
  • Length: total data packet length
  • Checksum: 16 bit 1's complement of the pseudo-ip-header which is an error check of the data packet.


Pseudo IP Header -- UDP

Applications that use the UDP Protocol

  • Trivial File Transfer Protocol (TFTP)
  • Domain Name System (DNS) name servers
  • Remote Procedure Call (RPC) on Network File System (NFS)
  • Simple Network Management Protocol (SNMP)
  • Lightweight Directory Access Protocol (LDAP)

3. Transmission Control Protocol (TCP)

TCP is a standard protocol with STD number 7. TCP specifications can be seen in RFC 793 -- Transmission Control Protocol.

TCP provides facilities for applications compared to UDP, because TCP provides error recovery, flow control, and reliability. TCP is also commonly referred to as a connection-oriented protocol.

Two processes communicating using a TCP connection is called InterProcess Communication (IPC). IPC is illustrated as in the figure below:


InterProcess Communication (IPC)

TCP Segment Format

The TCP format can be seen in the image below:


TCP Format

Where:

  • Source Port : 16 bit port number. Used to receive replies.
  • Destination port : 16 bit destination port number
  • Sequence Number: the initial data number in the segment
  • Acknowledge number: if ACK is set then this is the sequence number of data that will be received
  • Data offset: the number where the data section starts.
  • Reserved : for future use, set to 0
  • URG : activates an emergency point on a segment
  • ACK : acknowledge column
  • PSH : push function
  • RST : reset a connection
  • SYN : to synchronize sequence numbers
  • FIN : data deadline
  • Window : window number for the windowing process
  • Checksum: a number used to check the validity of the sender and recipient.
  • Urgent Pointer: points to an urgent point in a segment.
  • Options: used for other options in the datagram
  • Padding: used to round data in the options section

Programming Interface in TCP applications

Functions used in TCP communication include:

a. Open: opens a connection by entering several parameters, including:

  • Active / Passive
  • Destination socket information
  • Local port number
  • Timeout value

b. Send: sends data buffer to destination
c. Receive: Receives and copies data to user's buffer
d. Close: closes connection
e. Status: views information
f. Abort: cancels all send or receive activities

Applications that use the TCP Protocol

Almost all network applications use TCP, application standards that use TCP include:

  • Telnet
  • File Transfer Protocol (FTP)
  • Simple Mail Transfer Protocol (SMTP)
  • Hyper-Text Transfer Protocol (HTTP)

Post a Comment

Previous Next

نموذج الاتصال