LPI 101-500 – 109.1: Basics of Internet Protocols part 1
- OSI model, ports, address classes
So we are back to a completely new topic. Topic 109 deals with the basics of networks in general, and specifically the basics of Internet protocols. This topic becomes not very practical, but very theoretical. I don’t like it either, but unfortunately it has to be. Okay, well, let’s start first of all, very briefly about the story. I wouldn’t expect there to be any questions, but it’s useful to be able to say at least a little. The Internet as we know it today is the successor to the Arpanet. The Arpa stands for Advanced Research Projects Agency. Organization was founded in 1958 by the US. Department of Defense. DoD new military technologies should be developed.
However, these tasks were handed over to four external research stations which were linked by the Arpanet. Technically, the protocols that existed at that time could no longer handle this, however, and so the TCP IP protocol was developed at that time. The so called DoD model was used for this purpose, which is now replaced by the so called OSI model. OSI stands for Open Systems Interconnection Model and is a reference model for network protocols. As a layer model, even if the OSI model is not queried in the exam, it is necessary to understand it, at least fundamentally. I have prepared a small diagram for this. You can download this under this video.
I know it’s a little bit complicated and confusing, and it’s hard to remember and imagine. It is important to know that data pass through all seven layers here on both the sender and the receiver side. Let’s take a normal chat as an example. I will type the message into my chat window. At that point, we are on layer seven of the Oz model and on the sender side, of course, the data then pass through all layers in which they are processed and broken down. When it arrives at layer one, the data is physically sent and goes to layer one of the recipient. There the data goes through all layers until it reaches layer seven and the text appears on my chat partner screen. Okay, here in detail, we start on layer seven.
On the sender side, it is the application layer. The application layer provides functions for the applications available to the user. This is where the data input and data output instead. So screen, keyboard and so on. Then it breaks down to layer six, Presentation Layer the presentation layer transfers the data to independent form around, thus enabling data on both the sending and receiving systems can be read. Then layer Five Session Layer the Session layer enables communication from two process on different systems. There be services for synchronized and organized data exchange.
Use layer Four Transport Layer the Transport layer segments the data stream and takes care of it, ensuring that simulators incoming and outgoing data streams to not collide with each other. To be added certain control elements to the data packet. Famous layer four protocols are UDP and TCP IP. Then we have layer three network layer provides for the forwarding of data packets. Since rarely a direct connection between sender and receiver is given, there must be intermediate notes for the forwarding that can be used. Then layer two, data link layer responsible for error free transmission, shares the data stream and blocks and add checksums.
Incorrect blocks can be recognized by the recipient and discarded or corrected. And then we have layer one, physical layer. Lowest layer provides mechanical and electrical tools to activate or deactivate physical connections. So antenna, amplifier, plug socket, repeater hub, and so on.Okay, we have learned that both the TCP IP protocol and the UDP protocol are at home on the fourth layer. What is the difference? The TCP protocol is a connection oriented protocol. This means that the protocol checks whether the data is sent correctly and whether it arrives at the correct recipient. Therefore, the TCP protocol is used by most programs. The UDP protocol is a connection less protocol.
Here the data is simply forwarded and UDP no longer cares whether the data is correct and whether it has reached the correct recipient. The UDP protocol is used by programs that either cause very little data traffic, for example DNS, or by programs that do not expect a response from the recipients. For example, broadcasts so called ports are used so that corresponding data packets can be sent to the correct program for the test. For the exam, you should definitely know some port details by heart. I have prepared a list for this. These are the most important services in my opinion. You can find more ports on the corresponding websites. You can see here the service FTP for data Exchange has the port 20 with TCP and UDP.
The FTP for connection establishment, it is port 21 only TCP. We have Ssh port 22, TCP and UDP. You see, every port is TCP and UDP. Now we have Telnet here port 23 smtp port 25, DNS port 53, http is port 80, pop three is port 110, mtp port 123 imap port 143 SNMP, port 161, ldap 389 and Https is port four, four, three. If you no longer let me get back to my Linux. So if you no longer have the corresponding ports in mind and the Linux system is available, you can get this information from the file at C Services, because this is where the relationships between the service and the port are defined. So let’s take a look. BIFC Services and you see here the programs and the ports. So, as told before, we have here FTP data port 20, FTP 21, Ssh 22, telnet 23, Smtp 25 and so on.
So if new programs are installed manually, you may well have to create a manual entry in Etsy Services to tell Linux which port the new program is listening on. To check which port Https is listening on, we can ask Etsy Services, for example, with Grab I and then Https. And we can see here Https. We have port four, four, three. By the way, a total of 65,536 ports are available. 65,536 ports are available. The first 1024 ports. So port zero, two port 1023 are reserved and are also known as well known ports from port 1024. The ports can be freely selected for certain applications. To find out which ports the system is currently listen to or which ports are open, you can use two different commands once netSTART and one’s nmap.
Both commands are not installed by default on my Ubuntu, so I will just install it. Install net Tools and nmap the program the program netSTART is a program of net tools. Nmap stands for network mapper. Nmap is a port scanner with which computers on the Internet can be examined for open ports and the corresponding services. You can also check which ports are open on your own computer. For example, with nmap localhost and here nmap scan report for local hosts. Host is up not shown. 96 closed ports and we have 1234 open ports. Port 25 smtp, port 80 http port 631 is IPP and port 8443 it’s https alt so nmap done.
One IP address, one host up scanned in 0. 8 seconds. With net stat you can see which ports are currently in use. That’s that. And then I choose these options teupann and here we see the corresponding IP addresses. We will come to that in a moment. And the corresponding ports. Somehow I have acquired the toy pan options here toy Pan over time. The nice thing about netSTART is that you can adapt the overview. You get to your own liking. netSTART without an option looks completely different. Let’s see. It’s a complete different view than before with our options. And here is this view. You can of course read the options in the main page. As always, there are more here.
- IPv4 addresses
The IP protocol is located on the third layer. So on the network or packet layer, there is the IP four protocol and the IP Six protocol. The IP protocol adds a Socalled IP header to the individual data segments. So information on the source and destination address so that there can be delivered correctly. IP four addresses are 32 bits long. We will take a look at that in detail right away. But first, one or two sentences about IP six. IP six works the same as IP Four, but has a length of 128 bits. Further protocols of this layer are arp, icmp and IGMP. Well, let’s take a closer look at the IP four protocol. Surely you have seen an IP four address before. In the home network area, it is usually something like this 192, 168, one and then ten.
An IP four address basically has the length of 32 bits, which means that theoretically 4,294,967,296 different addresses are possible. N IP address is written in the form of four decimal numbers separated by dots. Note that each of these numbers is exactly one byte. That means the 192 is a byte, the 168 is a byte, the one is a byte, and the ten is a byte. Since one byte equals eight bits, four bytes are a total of 32 bits. For each byte, there are 256 different possible combinations. So from zero to 255. I know it is very, very confusing when you talk about bit and byte at the same time, but then write down the address in dead Semal notation. I hope the next example will make it easier to understand.
So such an IP address here could also be noted in binary notation. Let’s try it. An IP address therefore has four bytes, and each byte has eight bits translated into binary notation. This means that we have eight digits each. So basically like this 1234-5678-1235-4567, 8123-4567-8123-4567, eight. In decimal notation, this would correspond to the IP address zero. Okay, watch out. Now, the last number of these four bytes has always the value one, the number in front of it. So here is the first or the last. Sorry. The last number of these four bytes here has always the value one. The number in front of it has the value two. The number in front of it has the value four, then eight, then 16, then 32, then 64. And the first number has always 128.
So it looks like this 128, 64, 30, 216, 8421. These are the values that the individual bits have. The first bit has a value of 128. So here, the first bit has a value of 128. The second, this one here, has a value of 64, the third has a value of 32 and so on. So I think it is clear the right, the last one is one, and then we double the one, then it’s two. It’s this one here, then the next we double the two and it’s four. We double the four, it’s eight, we double the eight, it’s 16. We double the 16, it’s 32. We double 32, it’s 64 and we double 64 and it’s 128. In binary notation there are only zero and one, nothing else. Zero means as much as off, one means as much as on. So like a light switch. Okay, let’s look at the following notation 1712-3456-7812-3456-7812-3456-78.
This corresponds to the IP address one hundred and twenty eight, zero, zero, zero, y one hundred and twenty eight. Let’s look again at the table here. That I just wrote down the first number or the first bit. The first one is always 128. In this case the bit is set to one, so it is switched on. Therefore, this bit has the value 128. All other bits have the value zero. They are switched off. So the Pdres in decimal notation is let’s look at another notation. What does this notation mean? It would be the IP address 2240 zero, y 224. Let’s take our table here the first number. The first switch is on and it is 128. The second switch is also on, so it’s 64. So plus 64. The third switch is also on, so plus 32. And all the other switches are off.
So there is no no other number added. So we only have zeros here. So we have only this. 1128 plus 64 plus 33 equals 224. And then here plus zero plus zero plus zero. So we have this IP address here in binary notation. What would our buff mentioned? IP address 192, 168 one and ten. In binary form B, we get the table from right in front of our minds I and first look at the first byte. So at the 192 here, we go through the table from left to right and see whether the individual bit values fit into 192. So the first bit value is 128. The first bit value is 128. 128 is less than 192. So it fits in. So we can switch the light on it fits in 192. -128 that we switched on with the first bit r 64. So again 192 -128 which we have switched on here is 64 the second bit.
So this one here the second bit or this one or this one has a value of 64. And we have a rest of 64 here, so it fits exactly. We turn on the second bit, since the 192 has now been used up. The other six bits are automatically 012-3456 dot we do the same for the second byte. So with this 1168. We go from left to right in the table. Does the 128 fit into the 168? Yes, it does. So we turn on the first bit. 168 -128 equals 40. So there is a remainder. Of 40. Does the next bit value fit? The next bit value is 64. Does it fit in 40? No, it doesn’t fit. The next bit value is 64, but we only have 40 left. So the second bit is switched off. So we have a zero. Here the third bit has a value of 32 does the 32 still fit in the 40? Yes. So the third bit is turned on.
So we have a remainder of eight because 40 -32 is eight the fourth bit with the value 16 does not match. So we write a zero again. The fifth bit has a value of eight and therefore fits exactly into the remaining eight. So we switch the bid on with the one, and the rest is then of course, zero. Now we have the next one. The next byte is a one. Does the 128 fit into one? No. So zero. Does it fit in 64? No. In 32? No. And 16? No. In eight? No. In four? No. In two? No. In one? Yes. And the last is the ten. Does the 128 fits into ten? No. 64 into ten? No. 32 into ten? No. 16 into ten? No. And then eight into ten? Yes. So we switch it on with a one and we have ten minus eight. It’s two remaining of two. Does the four fits into into two? The two? No. Does the two fits into the two? Yes. And here is zero at the end.
So this is our IP address. 192, 168, 110 in binary notation. I think and hope that it became clear how this works exactly. It is important that you have understood and mastered this, because this is exactly what we need now when it comes to the subnet masks, because IP addresses are divided into different classes. First of all, it should be noted that every IP address consists of a network park part and a host part host. So computers whose network parts are identical to the IP address can communicate directly with one another. So you are in the same network. Host whose network share of the IP address is different, are located in different networks, and therefore cannot communicate directly with one another, and are dependent on a router that ensures that the data is routed to the correct network.
Which part of the IP address belongs to the network part and which part to the host part is determined by the subnet mask. But let’s first look at the individual address classes. You can find the PDF file under this video. Here we have a table of our net classes and address ranges. It is very important that you learn this. Remember this. For the exam we have class one, class A, class B, class C, class D and class E. Class A is the IP address range from zero, zero, zero to 127. 255, 255, 255. Class B is from 128 to or 1280. Class C, that is the private network. 109, 20002, 255, 255, 255. Class D net is 2240, zero, zero, 239, 255, 255, 255. And the last class E net is 242. 255, 255, 255, 255.
In order to find out which IP address belongs to which class? If you just can’t memorize it, you just have to change the IP address in binary notation and concentrate on the first byte. So to repeat, the first byte are the first eight numbers before the first dot. A class A network starts at 10 zero. In our overview, we have but it makes no sense because of that, it logically starts at 10 zero. That means in binary notation, that is the start of class A net. And in binary intended notation, it means that the one is the last position of the first byte. So here 123-4567, and the one, and then the other ones, that is the address 10 zero. In a class B network, the one moves from the last digit of the first byte to the first digit of the first byte.
So you have to remember this again. In a class B network, the one moves from the last digit of the first byte to the first digit of the first byte. So that would be 10000. And if you remember that, then after two years, you will know where a class B network begins, namely at 1280, because that binary notation is in decimal notation. And if you know where class B begins, then you know where class A ends, namely at 127. 255. 255, 255. In a class C network, another one appears right next to the first. So and we have our zeros here again, so we can see that it is the IP address 192. And that is the first IP address of class CNET, class A, class B, class C. And because of that, we know that the last IP address of class B network is 191. 255, 255, 255. A class D network gets a further one in the third place.
So one, one, one. And then we have again our zeros here, so we can read 200, 2240. So we know the last class C IP address is 223. 255, 255, 255. And you already guess it. The class E network will receive another one in the fourth place. So 1234, and again, our zeros here. So we know that the address range starts at 240. In the exam, there will definitely be at least one question in which you have to assign an IP address to a class, or vice versa. Either you memorize the classes or you practice binary mutation, and then you will always be able to figure it out yourself. Incidentally, I always had a pat and a pen handy for my exams. And this is a great way to write down the IP addresses in binary rotation location. And so you will know which IP address is located in which net class.