Now let's have a look at Layer 3. Layer 3 is the Network layer or sometimes called the internetwork layer. Now we said before that the size of a Layer 2 network is limited. You can't make them arbitrarily large. So the job of Layer 3 is to join multiple Layer 2 networks together and forward traffic from one network to another network and if necessary through another network and so on to reach the final destination. So these different networks that are connected together are called subnets, sub-networks, and together what you build is an internetwork, in other words the internet. Now one of the features of Layer 3 is you can join different Layer 2 networks together so you could have a network which mixes. There could be some Layer 2 ethernet and there could be some Layer 2 ppps and there could be some other Layer 2 technologies and the traffic can be forwarded from one to another to another and they don't have to stay on the same technology as it goes. So in order to achieve that Layer 3 introduces this concept of a datagram. This is a universal unit of data that can be carried over any kind of network. And the way it works is it's carried as the payload. It's carried inside a frame of one of the other Layer 2 networks and to make that happen Layer 3 needs its own addressing scheme because ethernet has one addressing scheme, 48-bit MAC addresses. PPP doesn't have any addresses. Other networks have other addressing schemes. So to make this work the Layer 3 datagram has its own unified addressing scheme which is independent of the underlying Layer 2 networks on top of that this unified addressing scheme is organized so that it can scale globally. Now another problem that we had with Layer 2 networks was having enormous numbers of MAC addresses. So if you build the internet and you have 100 million devices or 500 million devices connected there are 500 million MAC addresses and we couldn't build a table big enough probably to hold all of those MAC addresses but what we can do is we can allocate a range of ip addresses to each network and then we can just have a single entry in a table that says this entire range of ip addresses is reached through this particular network and that allows us to scale to something that we can can build on a global scale. Other features of Layer 3 then often there will be a way to identify the Layer 4 protocol. So again this allows us to have multiple mix and match Layer 4 protocols carried through the same Layer 3. And Layer 3 may also introduce the ability to do fragmentation and reassembly. That means if you've got a packet that's too big to go through a particular Layer 2 network then it can be broken into smaller chunks which gets sent separately over Layer 2 and then they get reassembled at the other end. So here's an example of Layer 3. It's the most common example you'll come across. It's the IPv4 datagram and the IPv4 datagram has a header and an information part. The header is 20 bytes and consists of a number of fields but the most important ones of those are the source and destination IPv4 addresses. Another field there called the protocol says what Layer 4 protocol is contained. So for example if that field contains the number 6 it means we're carrying TCP traffic and if it's 17 it means we're carrying UDP traffic. That would be describing what kind of data to expect in the information section, the header the most important parts of the header source and destination ip addresses.
© Produced by Philip Smith and the Network Startup Resource Center, through the University of Oregon.
Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
This is a human-readable summary of (and not a substitute for) the license. Disclaimer. You are free to: Share — copy and redistribute the material in any medium or format Adapt — remix, transform, and build upon the material The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms: Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. NonCommercial — You may not use the material for commercial purposes. No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.