Preamble:
This space will be utilized to synthesize my notes and help improve my learning process while I study for the CompTIA Network+ N10-009 certification exam. Please follow along for more Network+ notes and feel free to ask any questions or, if I get something wrong, offer suggestions to correct any mistakes.
Have you ever wondered how information travels from your computer to a website on the other side of the world? It all starts with a set of rules called the Transmission Control Protocol/Internet Protocol (TCP/IP) suite. Think of these protocols as the language and etiquette of the internet, working together to make sure data gets where it needs to go.
At the very heart of this system is the Internet Protocol (IP). It's the engine that gives every device a unique logical address and forwards data packets across different networks, a bit like the postal service for the digital world.
IPv4 Datagram Header
Ethernet works at the Physical and Data Link layers of the OSI model (layers 1 and 2). Ethernet, and other layer 1/layer 2 products, have no concept of multiple networks or of logical subdivisions within a network. This function is implemented at the Network layer (layer 3). As a layer 3 protocol, the Internet Protocol (IP) provides logical network addressing and forwarding.
The Internet Protocol (IP) header contains fields to manage the logical addressing and forwarding function. In IPv4, the header contains two fields for the 32-bit source and destination addresses, plus a number of other fields to support forwarding functions.
Visualization of the IPv4 header
The Version field indicates the version of Internet Protocol in use (4), while the Length fields indicate the size of the header and the total packet size (including the payload). The maximum theoretical size is 65,535 bytes, but actual packets would typically be much smaller to avoid fragmentation when transported as the payload of Ethernet frames, which usually have 1,500-byte MTUs.
The Protocol field describes what type of data is encapsulated in the payload so that the receiving host knows how to process it. For most packets, the IP protocol type value in the Protocol field will indicate a Transmission Control Protocol (TCP/6) segment or a User Datagram Protocol (UDP/17) datagram, which work at the Transport layer. The values assigned to protocol types, such as 6 for TCP and 17 for UDP, are managed by IANA.
Note: Those are the values in decimal. You are also likely to see them in their hex forms (0x06 and 0x11). Both formats ultimately represent 8-bit binary values (00000110 and 00010001).
Some Network layer protocols run directly on IP. These IP protocol types include the following:
- Internet Control Message Protocol (ICMP/1) is used for status messaging and connectivity testing.
- Internet Group Messaging Protocol (IGMP/2) is used with multicasting.
- Generic Routing Encapsulation (GRE/47) is used to tunnel packets across an intermediate network. This is used (for example) in some virtual private network (VPN) implementations.
GRE encapsulates an unsupported packet with a support packet.
- Encapsulating Security Payload (ESP/50) and Authentication Header (AH/51) are used with the encrypted form of IP (IPSec).
- Enhanced Interior Gateway Routing Protocol (EIGRP/88) and Open Shortest Path First (OSPF/89) are protocols used by routers to exchange information about paths to remote networks.
Layer 2 vs. Layer 3: The Difference Between Switches and Routers
When you design a network, it's crucial to understand the two main methods for moving data:
- Layer 2 forwarding, also known as switching, happens at a local level. Think of it as a delivery system within a single apartment building.
- Layer 3 forwarding, called routing, is how data is sent between different networks. This is like the global postal service that gets a letter from one city to another.
Devices on the same local network (or subnet) can talk directly to each other. They use Media Access Control (MAC) addresses to send data, which are like the unique apartment numbers within a building. To talk to a device on a different network, they must go through a router, which acts as the main post office. The router's job is to forward the data to the correct destination on the global network.
The following figure illustrates how both switching and routing components might be used in a typical network. The whole network is connected to the wider Internet via the WAN interface on the router. The router's other interfaces are used to divide the network into three logical subnetworks. These subnets are mapped to layer 2 segments, each implemented using a switch.
Network placement of routers and switches.
The Address Resolution Protocol (ARP)
So, how does a computer know which MAC address to use? It uses the Address Resolution Protocol (ARP). When your computer wants to send data to another device on the same local network, it uses ARP to look up the destination's MAC address based on its IP address. It's like asking the front desk for someone's apartment number after you have their name.
If the destination is on a different network, your computer knows it must go through its default gateway (the router). In this case, it uses ARP to find the MAC address of the router's interface, so it can send the data on its way to the next hop.
Types of IP Addresses: Unicast, Broadcast, Multicast, and Anycast
While most of the traffic on the internet is unicast (one-to-one communication), there are other types of addresses used for special purposes.
- Unicast: A packet sent from a single source to a single destination.
- Broadcast: A packet sent to all hosts on a single network. The last address in any network or subnet is always the broadcast address. Routers do not forward broadcasts, so this type of traffic stays contained within its own network. At Layer 2, broadcasts are sent to a special MAC address (ff:ff:ff:ff:ff:ff).
Unicast and broadcast addressing.
- Multicast: This is a one-to-many communication where a single host sends content to a select group of other hosts that have expressed interest in receiving it. This is often used for things like streaming video. In IPv4, addresses from 224.0.0.0 to 239.255.255.255 are reserved for multicasting.
- Anycast: A special technique where a group of hosts are all configured with the same IP address. When a router needs to send a packet to this address, it sends it to the "closest" or most responsive host in the group. This is used for load balancing and to make services more resilient.
Multicast and anycast addressing.
We've covered a lot of ground here, from the big picture of how TCP/IP works to the nitty-gritty of IP addresses and the roles of routers and switches. Don't worry if it all doesn't click at once. Networking can feel like a maze at first, but with each new piece of information, the map becomes clearer. The most important thing is to keep exploring and building on what you've learned. The journey into IT is about understanding how all these pieces fit together to create the incredible, interconnected world we use every day. Keep learning, and you'll be navigating the network like a pro in no time!
Top comments (0)