Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
"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 microsoft.com/mspress/books/sampchap/5507a.aspx microsoft.com/mspress/books/sampchap/5507/0735614563-06.gif –  barlop Mar 18 '12 at 4:56
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 Mar 18 '12 at 5:00

2 Answers 2

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.

share|improve this answer
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 Mar 18 '12 at 4:00
(4) Does data unit grow bigger or smaller as moving to lower layer? –  Tim Mar 18 '12 at 4:10
(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." –  ultrasawblade Mar 18 '12 at 4:35
(4) Will grow larger as more headers are "tacked on" - the technical term for this is "encapsulation" google.com/… –  ultrasawblade Mar 18 '12 at 4:37

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.

share|improve this answer
Thanks! +1. In OSI model, are data units becoming smaller or bigger as moving from a higher layer to a lower layer? –  Tim Mar 18 '12 at 4:43
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 Mar 18 '12 at 5:24
Thanks! Does each layer do fragmentation? –  Tim Mar 18 '12 at 5:29
Not usually, no. –  David Schwartz Mar 18 '12 at 5:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.