Monday, December 7, 2015

Week 14: Day 037 - Routing #2


Hello everybody, today's entry will not be like it normally is. What I will do in this entry will become a regularity, and the normal entry. Basically, to pick of the pace, I will be doing shorter entries, which end up covering more topics. Anyways, let's get right into it!

Routers, they let you connect to many types of network technologies. They can also connect to anything that stores IP packets. As a typical alternative to Ethernet, people use DOCSIS (Data-Over-Cable Service Interface Specification) or more commonly known as "cable modems" and much less known as, Frame Relay, and ATM (Asynchronous Transfer Mode). These technologies as you can imagine, work very differently from Ethernet. The only thing they have in common is that they carry IP packets within their Layer 2 capsules. Most professional, not home, routers let you add interfaces. To do so, you buy snap in interfaces to fit your needs. If you connect Ethernet to ATM, but an Ethernet and ATM module. While if it's Ethernet to Cable Modem/DOCSIS, buy an Ethernet module and DOCSIS module.

Now, it's time to get to one of the most important, and coolest things of networking. This is called Network Address Translation (NAT) a form of network security. Basically, when you have got something as good as TCP/IP and routers, that's great and all, but it poses a security risk. What will stop a jerk from putting malicious programs on your computer? The IANA assigned it's last IPv4 addresses, February 2011. You now get your IP address from an ISP. Routers all run NAT, which will essentially hide the IP addresses of computers on your LAN, and let you connect to the internet at the same time. This is used all around the world, and I must know more about it! Now let's get this clear, NAT is not routing, it's a separate technology. My textbook gives a hypothetical situation which I will follow here. I have LAN with eight computers which need to access internet. First, I will call my ISP and buy a network ID. Then I will give an IP address to every computer that I want on the network, and then will connect these devices to the LAN of the router. Third, I will assign the ISP router's IP address to my WAN connection on the local routed (ex: 1.2.4.1) All the clients on the network will have the same default gateway. The gateway router acts as the default gateway. That network stlye is how computers in LAN connected to the internet for the first 20 years, but the security issues heightened the more computers were added to the world wide web. Now, NAT fixed these issues, and here's the concept: The router replaces the source IP  with its outside interface address in outgoing packets. The simplest NAT is "basic NAT", and it does just that (translating private IP to global.) Then we've got "dynamic NAT" which in contrast can share a pool of routable IPs fewer than the amount of computers. Like if it had 10 routable IPs for 40 computers. It's known as Pooled NAT as well.

Then there's PAT (Port Address translation) is a form of NAT, the most common, which handles the one-too-many problem. This is how it works. You have a network at your office, it uses private IP addressing of 192.168.1.0/24 and all the computers in the private network will have to connect somehow. It uses a single PAT router, with the global IP address 208.190.121/24 for example. When a machine within the network wants to start a session with an external machine, it uses the source and destination IP, and port numbers for the TCP or UDP datagrams, which are then recorded in the PATs translation table, and the private IP gets swapped for the public IP on every packet sent. The port number is used by the internal computer for the session, and is translated into a unique port number for the router. Then when the receiving system sends the packet back,  the IP addresses and ports are reversed. The PAT router then compares the incoming destination port and source IP to what's in the NAT translation table, so it can decide which IP address to put back on the packet.The packet is then sent to the correct computer. This whole mapping enables perfect tracking of what goes in and out. PAT handles many internal computers with one public IP address, because the TCP/IP port is big. The TCP/IP port literally has values ranging from 1 to 65535. Some of those port numbers are common, but many are available for PAT to do its job. Since the router is revising and sending the packets, why not enable it to handle ports? This stage is called port forwarding.
But... I ALREADY KNOW PORT FORWARDING! HAHA! Because of this, I will not go over it. However a couple of things to note, port forwarding is when a specific local address is designated for network services. Port 80 is for HTML (kind of already knew that...just in case.) Finally you should configure NAT on home routers. By default the router is set to Gateway, which means "NAT is turned on." Mike Meyers says "If I wanted to turn of NAT, I would set the radio button to Router." okay, sir. That ends my entry for today, thanks for reading. 

No comments:

Post a Comment