Networking: Difference between Transport layer and

2019-03-08 12:41发布

问题:

In Internet Model there are four layers: Link -> Networking -> Transport -> Application.

I don't really know the difference between networking layer and transport layer. As I read:

Transport layer: include congestion control, flow control, reliability ...
Networking layer: route data from A to B

So, base on above properties, I see that there are some overlaps between those two layers.

1) Networking layer decides to move data from A to B. But, when data has known how to moved from A to B, what does it means for term "flow control" "congestion control" ... ? How and What does it control when the packet (and byte stream is in packet) has already known to moved across network.

2) Or other example, TCP protocol in Transport layer is ORDERED delivery of a stream. But, TCP doesn't decide how to move data, but Networking layer. So, how can TCP can do ?

So, I cannot get in those two terms. Please teach me.

Thanks :)

回答1:

These are levels of abstraction.

Transport Layer is where the decision to use TCP/UDP is made. Among commonly used protocols in this layer, TCP is reliable, UDP isn't. Depending upon the choice made, the respective headers are attached to your packet. TCP for example just knows about SYN-ACK, Three-way handshake mechanisms, but does not know the address of the remote-endpoint, or the mechanism of getting the packet across the network.

Congestion control, Flow control help ensure that the network isn't flooded with packets, by regulating the number of packets being sent.

Now, after TCP/UDP header being appended, it moves on to the Network Layer. Till this step, the remote end-point's IP address wasn't a part of the packet at all. It is at this step that the Source & Destination IP addresses are added to the packet. This layer actually knows the remote-endpoint.


      Sender                          Receiver


    -----------                      ------------
   |           |   virtual link     |            |
   | Transport | -----------------> | Transport  |
   |           |                    |            |
    -----------                      ------------
         |                                |
         |                                |
    -----------                       -----------
   |           |    virtual link     |           |
   |  Network  | ------------------> |  Network  |
   |           |                     |           |
    -----------                       -----------
         |                                |
         |                                |
    -----------                       -----------
   |           |                     |           |
   | Physical  |                     | Physical  |
   |           |                     |           |
    -----------                       -----------
         ↓                                 ↑
         |____________real link____________|

The sender's Transport Layer data, is the exact data received by the receiver's transport layer.

As the packet travels down the sender, each layer is adding its own header information, but all of that is removed by the corresponding layer on the receiver.

The advantage is that a virtual link is established, like the one shown above, whereas the real link is only in the physical layer.



回答2:

Transport layer:

  • Logical communication between processes.

Network layer:

  • Logical communication between hosts.

Transport layer:

  • Responsible for checking that data available in session layer are error free.

Network layer:

  • Responsible for logical addressing and translating logical addresses (ex. amazon.com) into physical addresses (ex. 180.215.206.136)

Transport layer: Protocols used at this layer are :

  • TCP(Transmission Control Protocol)
  • UDP(User Datagram Protocol )
  • SCTP(Stream Control Transmission Protocol)

Network layer: Protocols used at this layer are :

  • IP(Internet Protocol)
  • ICMP(Internet Control Message Protocol)
  • IGMP(Internet Group Message Protocol)
  • RARP(Reverse Address Resolution Protocol)
  • ARP(Address Resolution Protocol)

Transport layer:

  • This layer ensures that the protocols operated at this layer provide reliable end-to-end flow and error control.

Network layer:

  • This layer controls routing of data from source to destination plus the building and dismantling data packets.


回答3:

Transport: Determines how data is to be sent: Reliably or unreliably. Defines well known services (ports.)

Network: Provides logical addressing, finds best path to a destination.



回答4:

Transport Layer:

The fourth and “middle” layer of the OSI Reference Model protocol stack is the transport layer. I consider the transport layer in some ways to be part of both the lower and upper “groups” of layers in the OSI model. It is more often associated with the lower layers, because it concerns itself with the transport of data, but its functions are also somewhat high-level, resulting in the layer having a fair bit in common with layers 5 through 7 as well.

Recall that layers 1, 2 and 3 are concerned with the actual packaging, addressing, routing and delivery of data; the physical layer handles the bits; the data link layer deals with local networks and the network layer handles routing between networks. The transport layer, in contrast, is sufficiently conceptual that it no longer concerns itself with these “nuts and bolts” matters. It relies on the lower layers to handle the process of moving data between devices.

The transport layer really acts as a “liaison” of sorts between the abstract world of applications at the higher layers, and the concrete functions of layers one to three. Due to this role, the transport layer’s overall job is to provide the necessary functions to enable communication between software application processes on different computers. This encompasses a number of different but related duties

Modern computers are multitasking, and at any given time may have many different software applications all trying to send and receive data. The transport layer is charged with providing a means by which these applications can all send and receive data using the same lower-layer protocol implementation. Thus, the transport layer is sometimes said to be responsible for end-to-end or host-to-host transport (in fact, the equivalent layer in the TCP/IP model is called the “host-to-host transport layer”).

Network Layer:

The third-lowest layer of the OSI Reference Model is the network layer. If the data link layer is the one that basically defines the boundaries of what is considered a network, the network layer is the one that defines how internetworks (interconnected networks) function. The network layer is the lowest one in the OSI model that is concerned with actually getting data from one computer to another even if it is on a remote network; in contrast, the data link layer only deals with devices that are local to each other.

While all of layers 2 through 6 in the OSI Reference Model serve to act as “fences” between the layers below them and the layers above them, the network layer is particularly important in this regard. It is at this layer that the transition really begins from the more abstract functions of the higher layers—which don't concern themselves as much with data delivery—into the specific tasks required to get data to its destination. The transport layer, which is related to the network layer in a number of ways, continues this “abstraction transition” as you go up the OSI protocol stack. Network Layer Functions

Some of the specific jobs normally performed by the network layer include:

Logical Addressing: Every device that communicates over a network has associated with it a logical address, sometimes called a layer three address. For example, on the Internet, the Internet Protocol (IP) is the network layer protocol and every machine has an IP address. Note that addressing is done at the data link layer as well, but those addresses refer to local physical devices. In contrast, logical addresses are independent of particular hardware and must be unique across an entire internetwork.

Routing: Moving data across a series of interconnected networks is probably the defining function of the network layer. It is the job of the devices and software routines that function at the network layer to handle incoming packets from various sources, determine their final destination, and then figure out where they need to be sent to get them where they are supposed to go. I discuss routing in the OSI model more completely in this topic on the topic on indirect device connection, and show how it works by way of an OSI model analogy.

Datagram Encapsulation: The network layer normally encapsulates messages received from higher layers by placing them into datagrams (also called packets) with a network layer header.

Fragmentation and Reassembly: The network layer must send messages down to the data link layer for transmission. Some data link layer technologies have limits on the length of any message that can be sent. If the packet that the network layer wants to send is too large, the network layer must split the packet up, send each piece to the data link layer, and then have pieces reassembled once they arrive at the network layer on the destination machine. A good example is how this is done by the Internet Protocol.

Error Handling and Diagnostics: Special protocols are used at the network layer to allow devices that are logically connected, or that are trying to route traffic, to exchange information about the status of hosts on the network or the devices themselves.



回答5:

Cthulhu's explanation is ok but in order to understand a bit better, I recommend that you should read on the OSI Model

Transport layer handles port numbers, TCP, UDP, layer 4 PDU's and it's the first step in encapsulating and segmenting data in order to send it across the network

PDU = protocol data unit , it's a piece of information containing a header, the data segment and maybe a footer (see layer 2 encapsulation)

Network handles ip routing and delivery of data packets across the network

Each layer (regardless if it's OSI model or TCP/IP model with 4 layers) , each layer interacts with it's adjacent layer and provides an abstract framework for today's telecom purposes

Regarding your questions :

1). Flow control is a TCP mechanism for handling the size of the packet in order to prevent packet loss and retransmision, congestion control is another thing. Network layer doesn't decide anything, it simply tries to send your package over a network, if it fails, it will notify the upper layer about this problem and then the application or user should decide what to do).

2). TCP enables a 3way handshake mechanism to start a session, afterwards each packet is market with a counter and the receiver acknowledges receipt of senders package. In case he doesn't acknowledge, TCP resends that lost package. Networking layer will only forward packets and won't make any decisions regarding traffic control or packet ordering.

Further details are available in CCNA1 documentation or on the web.



回答6:

Considering the ISO/OSI reference model transport layer is 4th layer. It mainly deals with the end to end delivery of the packets. End to end means it is responsible for delivering the packet to the appropriate port. Network layer on the other hand is 3rd layer and is responsible for delivering the packet only to the host not to any specific [port/process in the system. People do have the doubt that when you have transport layer which can deliver the packet from one end to other than why do we have network layer? The simple answer to this question is that network layer is responsible for carrying the packet from sender to destination. But after reaching the destination it depends on the transport layer to deliver it to appropriate port number or process(in operating system terminology). Moreover at network layer we IP protocol which is heart of internet. You can read more about this here.