Network Basics: Easy Addressing and Routing
Network Basics: Easy Addressing and Routing is all about the TCP/IP protocols and what they do. Our present day internet is totally dependent on this system because because of how it developed and without a doubt it can be confusing.
Think about it:
The reason TCP/IP was used was because it was rock solid. However, it seems like there are a million details to it and I am sure you would agree with me. The addressing and routing that moves all of our internet traffic between Facebook, Twitter, and all of our other favorite websites uses TCP/IP primarily so there has to be a reason for it right? There really is so let me explain to it to you.
Easy Addressing and Routing
IP addressing is the system that dictates how every device communicates with each other over a private network or the internet as a whole. Every device must have a unique name and be identified thusly so all our computers who to talk to.
Our current system of addressing uses standard IPv4 mostly because that is what people have used for many years. IPv4 is actually divided up into classes depending on the size of the networks and how it is used.
IPv6 is the newest system and it is our insurance for the future because it has a multitude more addresses to use. We have this system because IPv4 is running out of addresses soon and this just can not happen. So IPv6 will prevent any address shortages for a long time by our standards.
All computers or network devices need an IP address if they are to talk over small networks or the internet. Addresses are composed of four sets of numbers and they look like the form of 123.456.789.001. Each position represents and on/off bit which can either 0 or 1. This is just decimal to binary conversion but it is good to know anyway.
IP addresses are divided up into classes so it will make more sense when we see an address. There are class A,B,C in use and two more which are D and E. Those last two classes are reserved and are not actually in production use. The address class tells you which of those bits are used for the network ID and which are used for the host ID. This indirectly tells us how many hosts can be on any one network.
- a network that uses subnetting is considered a classless
- the classful system has several limitations
- many networks still rely on classless addressing and custom subnet masks
- IPv4 identifies a network or subnet and the host
- they are a 32-bit binary number
- represented in dotted decimal notation
- the address is divided up into two parts: a network identifier and the host divided by subnet mask
- each host is required to have a subnet mask when using IPv4
- the subnet mask is used to distinguish the network identifier from the host identifier
- it divides the IPv4 address into those parts
- subnet masks can be notated in dotted decimal or in CIDR notation
- a subnet mask that divides an IPv4 addressin half would be 255.255.0.0
These addresses are organized into classes for ease of distribution.
- they are defined by the number in the first octet and the default subnet mask
- Class-A networks use a 255.0.0.0 subnet mask
- Class-B networks use a 255.255.0.0 subnet mask
- Class-C networks use a 255.255.255.0 subnet mask
Class A Network
Class A networks are extremely large and have the largest number of hosts linked together. A host is a computer or some other type of network device that is on a particular network. The first octet is for the network ID while the last three octets are for the hosts. This kind of network can have 126 networks on it and each network can have over 16 million hosts on each network. It has a range of 1-126 in the first octet.
Class B Network
These networks are still quite large but represent the mid size networks. They can comprise 16384 networks and 65534 hosts on each network. It has a range of 128-191 in the first octet.
Class C Network
These are for smaller networks whether a home local area network or a small business network. This type of network class allows for around 2 million networks and close to 250 hosts per network. The range for this class is 192-223 in its first octet.
A subnet looks like an IP address because it has the same format. However, the purpose of a subnet is to tell you which parts of the IP address refer to the network address and which parts are the host addresses. The different classes of networks that I just mentioned above each have a certain subnet associated with it.
- A = 255.0.0.0
- B = 255.255.0.0
- C = 255.255.255.0
Subnetting redefines the network portion to lengthen the mask beyond the default classful mask. It extends the network portion and allows one classful network to be repurposed as many classless subnetworks.
Purpose of Subnetting
The very important purpose of subnetting is to create more networks and therefore divide your network and its topologies up into more manageable pieces. For small network or home local area network then this does not apply but for a large network it makes good sense. The reason it makes good sense is that you can separate your departments by IP address or have a certain IP range for just your printers.
When you have a certain IP range for your HR department then you can keep HR's network traffic on its IP range. This keeps one department's network traffic from impacting another department. The important thing to remember here is that subnetting increases your network but decreases your available hosts.
This type of network is just as it sounds. It is a public network that anyone can join and use the resources on. An example of a public network is something like a cafe offering free wireless while you drink their coffee. They usually have very limited speed and reliability. There is usually no authentication either.
This is a type of network that does not allow access to just anyone. It will usually use a certain user name and password for each individual that wants to connect to it. However, these networks are usually faster and have more resources. Private IP addresses are provided for internal communication within an organizational environment.
Addresses of Private Networks
All networks have certain ranges within them that are used by only that network. This is called a private range. Public facing routers do not pass on information from private networks so that is why you can not use a private address on the internet. The private addresses must stay within a private network.
- A = 10.0.0.0 to 10.255.255.255
- B = 172.16.0.0 to 172.31.255.255
- C = 192.168.0.0 to 255.255.255.0
This is a lot longer address that offers a lot more IP addresses. It is a 128-bit address and it is written as 32 hexadecimal characters. IPv6 offers support for unicast, multicast, and anycast communication.
- Unicast address is for a single interface
- Multicast address is for a one to many interfaces and uses a larger address range.
- Anycast is also a one to many type of addressing. Multiple devices can share the same address
This generates the host IP addresses internally using stateless address autoconfiguration. It is also used to assign link-local addresses.
- Does not require the host to be aware of its present state to be assigned an IP address by the DHCP server.
- If autoconfiguration is not going to be used then hosts can be assigned an IP address with DHCPv6.
This is just the path from a local network to the rest of the networks in the world, or the internet. From a local area network's perspective it is the IP address of your router. That is the path out to the world from your local clients. When traffic on a local network is destined to go to another computer on that same network then things are pretty simple.
The traffic goes to where it needs to pretty quickly because all of the computers on the local network are already known to the rest of the computers. Everyone knows everyone in this sense.
However, when traffic needs to leave the local network it has to go through the gateway device. The gateway can be another computer but is usually a local router. The router communicates to other routers depending on where the traffic needs to go. Your router or gateway knows the routes so that your network traffic can get to the next step in its trip.
If there is no gateway device on your network or it is not configured to let traffic through then all your traffic will stay on your local network. An example of this is an application I run at home but I want it only on my local network so I do not set up my router to let its traffic go past my router. Since there is no route to go past my network then it will not use my gateway device.
Types of Addressing
There are different types of addressing and they are unicast, broadcast, and multicast. They serve different purposes depending on the situation.
When a unicast is started the packet information is sent to a specific IP address. This is useful when you want information to only go to one destination. This is the most common form of addressing as the other types are newer and legacy devices might not support them.
This is when packet information is sent to to everything on your network or wherever your network can communicate to. It is sent from one device to many devices that are on your network.
Using a multicast, groups of devices on your network can send and receive information at the same time.
Assigning IP Addresses
There are two main ways to give your devices an IP address on your network. The first of which is doing it manually and this is called static addressing. Addressing your pc's and printers this way can take a long time so if you do it this way then you have to double check yourself. There are advantages to doing it this way if you need to because some devices you do not want changing addresses such as printers.
The other way to address your devices is letting DHCP do it and this is called dynamic addressing. DHCP is a protocol I have talked about before and it will run on a server to do the work of assigning IP addresses for you. It is most common to let DHCP handle your computer addressing in this way.
Devices that need their IP addresses entered manually will have some way to input the addresses on a panel like printers do. I have to do this myself as I enter all of the printer IP addresses manually and then keep track of them through documentation. Then when someone needs to print to a certain printer I just look at the documentation if I need to set it up remotely.
Dynamic addressing is when the addresses are assigned and changed as needed. They are handled by the DHCP protocol and it does a great job of it. When a computer's address has been assigned to it, it will be for a certain amount of time and this is called its lease.
Just like when you lease a car it is for a specific time period. IP addressing is done the same way. After this lease runs out DHCP will assign different addresses to devices as they are needed.
Anything that needs to stay the same like switches or printers can also be put on a reservation which is similar to static addressing but within the DHCP sphere.
The BootP protocol was designed for network devices that needed to connect to networks and that did not have internal storage. The BootP application would be run on a server and and devices on the network that needed an IP address would call out to the server to get the correct information. The server uses MAC addresses to authenticate and keep track of the different devices.
An example I see often is printers having BootP in their set up. This is because printers do not usually have hard drives and BootP gives it one way to connect to a TCP/IP network.
The MAC address of a device is the way to uniquely identify any device. Calling it the physical address is also accurate and this is used a lot. It uses a hexadecimal form and contains six different bytes of information in the address part.
An interesting fact is that the first three bytes of the address define the manufacturer of the network card and the last three bytes are given by the manufacturer to identify the network card.
Being hexadecimal in nature the addresses use the numbers 0-9 and the letters a-f in the address.
There is a newer and longer form of the MAC address now and it uses extra bytes and dashes in the address to differentiate it from its older cousin.
- 48-bit long and represented in 12 hexadecimal characters that is hard coded into the network interface when it is made.
- They are completely unique to each network interface.
- The MAC address of a network card operates at the Data link layer of the OSI model.
- They are often called the physical addresses
MAC Address Filtering
This is a simple process of only allowing equipment to join your network if its MAC address has been previously approved by adding them to a list.
- Any MAC address that is not approved will not be added to the ARP table and none of its broadcasts will be sent out to the network at large.
Network Address Translation
This is very important for one reason and that is because there are not enough IP's in the world. NAT allows us to just use one public IP that others can see. There can be many local IP's hiding behind this one public IP and these are the private address ranges that I mentioned earlier.
Your public IP is often a router and it will handle the network address translation protocol for your networking hardware. The router will then keep track of which machine on your network sent information so if information goes back to this machine then the router will make sure any data goes back to this machine. This is basically how network address translation works.
- Router based service which allows a router to change the IP addresses of the packets that they send.
- The private IP address never leaves the private side of the router because it is replaced, via NAT, with a routable public IP address.
- Commonly used to translate private IP addresses to public IP addresses.
Allows a one to one translation of public to private IP addresses to be configured.
- Often used to provide a translation for an internal server that must be reached from the internet.
Port Address Translation
The port address translation protocol allows an administrator to just use one IP address and configure his clients to use certain ports that will allow traffic. Doing things like this is especially useful if you want to secure your network a little more than usual because it hides so much of your client's information.
- Is a form of dynamic NAT which allows many IP addresses to translate to a single public IP address.
- Maintains separate entries for each of the sessions passing through the router by recording the source and destination ports of the sessions.
- It is extremely popular and is used primarily to provide many workstations the ability to access the internet without each needing their own IP address.
This is also called the destination network address translation protocol. That is a long name but people rely on this every day. This is handled at the router level to change where network packets are sent. Their IP addresses are changed for the destination and this allows applications to communicate through networks. Gamers use this all the time when they want to play the same games together even though they may not realize it.
A broadcast is a transmission sent from one device which is destined for all other devices in a network.
- They are the area of a network through which a broadcast propagates.
- Subnets can be interconnected by a router.
- The broadcast originating in one subnet is then not propagated into another subnet.
A collision can occur when two different Ethernet devices on a network transmit data simultaneously.
- Collision domains are the portion of a network across which only one frame can exist at one time.
Routing is the backbone of the internet and wide area networks. Without routing the devices on your network would not be able to get out to other networks.
A routing loop can occur when static or dynamic routing is incorrectly configured.
- They can be identified with the traceroute utility.
- If a packet hits the same router more than once, this is a good indication of a routing loop.
- Packets in a routing loop will be forwarded between two or more routers until the TTL expires.
Managing TCP/IP is a straight forward process. Computers and routers deal with the routing tables that specify paths for your network information. You then just decide what type of routing you want to do and that is either static or dynamic routing. Variations exist as well and those are distance-vector and link-state routing.
Routing tables keep track of the paths for information. Computers and routers look a them and decide which is the fastest route. This helps make the network reliable and as quick as possible. Your router needs this information to send data through and it can get it by either static or dynamic routing.
- Routers maintain their own routing table.
- These tables contain information about the networks directly attached to the router.
- They also contain entries that inform the router how to get to all subnets or classful networks in a topology.
- Most routers have a default route.
- The default route provides the router with a direction to forward traffic when it has no other information.
- Routers share their routing tables with other routers in the environment.
Static routing is manually entering your network information into your devices. If you have a very large network this can take you lots of time and there are probably better options out there. Changes to a network also make this more complicated and a headache because you then have to go back and manually update your devices again.
- This type uses a route that a network administrator enters into the router manually.
Dynamic routing has the routers retrieving its own information as it needs and it uses protocols to do it. The routers communicate among themselves to establish the best route for network packets. Dynamic routing uses the distance-vector and link-state protocols.
- Uses a route that a network routing protocol adjusts automatically for topology and traffic changes.
Routers use this protocol to talk to the routers that are directly connected to it and show each of them its own router information. Routers have worked like this for a very long time. Network information travels from one router to the next like this in a series of hops. Routers update their routing tables very frequently and in a large network this causes a lot of traffic over time, it can slow down the network, and errors often happen between routers.
Routers that use link-state routing have an entire layout in their memory of routes to send network information to. This is in contrast to distance-vector routing where routers only know about the next hop. So link-state routing is much quicker and efficient. Updates between routers still happen but do so less frequently because the routers know so much more about the network they are on.
Proxy servers are part of your security plan for your network and often work with your firewall. They send and accept network traffic on behalf of your clients. A proxy server adds more functionality to your network system to help protect it. Adding speed to your network through the process of caching is one of the major benefits of a proxy server.
Everyone wants high availability in their systems. They should always be up.
- A first hop router redundancy protocol can provide redundancy for a default gateway.
- There is Virtual Router Redundancy Protocol
- Also there is Hot Standby Router Protocol
Hop counts is something that we can measure and monitor. This is the number of stops a packet will need to make before it reaches its destination.
- Bandwidth and the maximum size of the data packets that a route can carry.
- There is also the cost and efficiency of the router.
- Latency is also important and this is the time it takes for a data packet to traverse the route to reach its destination
A lot of things happen in order for your network information to get from one network to another. You have different routes and many protocols that can be used depending on the situation. There is never a shortage of options or acronyms when learning about this either. Understanding subnetting and the routing of traffic are especially important here.