Does the link layer pass frames or datagrams to the network layer?

1

1

If I am correct, at a source node, the network layer passes the datagram to the link layer. Then the link layer breaks the datagram into frames, and move entire frames from one network element to an adjacent network element.

I was wondering at the destination node, does the reassembling of frames into datagrams happen in the link layer or the network layer? Does the link layer pass frames or datagrams to the network layer?

Generally, at a source node, when passing from a higher layer to a lower layer, does the breakdown of bigger data units into smaller data units happen in the lower layer.

At a destination node, when passing from a lower layer to a higher layer, does the reassembling of smaller data units into bigger data units happen in the lower or higher layer?

Thanks and regards!

Tim

Posted 2012-03-18T03:13:34.970

Reputation: 12 647

"link layer" rings a bell with me for some reason, but a quick search shows it's called the "data link layer" in the ISO OSI model. not "link layer". and the "data link layer" has a logical link is split into 2 sublayers - logical link control, and media access control http://www.microsoft.com/mspress/books/sampchap/5507a.aspx http://www.microsoft.com/mspress/books/sampchap/5507/0735614563-06.gif

– barlop – 2012-03-18T04:56:07.680

also, and i may be wrong, but I think when going down the layers, the data is getting -bigger-. it's assembly(to use your term). and up the layers it's getting smaller, disassembly. (that's the opposite of what you wrote), I guess i'm correct there 'cos I see from some comments that you expressed some doubt yourself(which is good), and your terminology is definitely wrong like "network element" I think you made up that term. – barlop – 2012-03-18T05:00:24.243

Answers

1

Network layer needs as an input a source/destination IP address and source/destination port, i.e. it must be a series of bytes in the standard form of an IP packet. So the Ethernet headers and footers need to be stripped off before the network layer gets them, otherwise when the network layer looks at certain offsets for the data it needs, such as source IP address, etc. it would get them wrong.

There's nothing "labeling" the fields in an IP packet, they are identified by position in the packet. So the lower layer needs to give the network layer an IP-compliant stream of data not an Ethernet-compliant stream of data.

Conceptually this is what should/would happen but only examining the source code or disassembly of a TCP/IP implementation would give you precise answers or exactly how the "labor" is divided in software. In a situation where you have an embedded device that would only run one possible NIC hardware device you could probably couple the network, data link, and physical layers very tightly, and I'm sure dedicated hardware routers, etc. do this. In a situation where you have a general purpose operating system supporting a wide array of hardware you couldn't do that.

As far as transmission, the same thing applies. The NIC card needs a source and destination MAC, which appears at specific positions in an Ethernet frame. So having the network layer directly ship a packet to the NIC would fail as no Ethernet header containing source/destination MAC would be attached to it.

LawrenceC

Posted 2012-03-18T03:13:34.970

Reputation: 63 487

Thanks! +1. (1) Where can I see such code/implementation? (2) Do you mean when data is passed from a layer to another in an OSI model, the current layer must convert the data to the form for the next layer before passing it to the next layer? (3) Is NIC card in the linker layer? – Tim – 2012-03-18T04:00:43.040

(4) Does data unit grow bigger or smaller as moving to lower layer? – Tim – 2012-03-18T04:10:49.907

(1) FreeBSD source code is a great start, as is the Linux source code. (2) Yes as the each layer has specific expectations of what data means at certain positions in the given stream. (3) NIC generally covers layer 1 and 2, and even up to layer 4 if the NIC has a "TCP Offload Engine." – LawrenceC – 2012-03-18T04:35:59.907

1

Frames are re-assembled into datagrams at the IP layer in systems that use TCP/IP. This is because the TCP/IP stack does fragmentation at the IP layer. The IP layer requires a layer beneath it that can carry frames but it does not require that a frame be large enough to carry an entire datagram. So the IP layer performs both fragmentation and re-assembly.

David Schwartz

Posted 2012-03-18T03:13:34.970

Reputation: 58 310

Thanks! +1. In OSI model, are data units becoming smaller or bigger as moving from a higher layer to a lower layer? – Tim – 2012-03-18T04:43:06.450

It can be both. They can become bigger because each layer can add new header and auxiliary information. They can become smaller because a layer can do fragmentation. – David Schwartz – 2012-03-18T05:24:16.607

Thanks! Does each layer do fragmentation? – Tim – 2012-03-18T05:29:34.317

Not usually, no. – David Schwartz – 2012-03-18T05:32:08.390