 Hi everyone again welcome to this lecture today we will be continuing the Linux networking lecture before we begin actually let me recap what we did last the last lecture we actually started talking about the networking and we define what the network is essentially the networking how multiple computer or components they communicate with each other we started actually like I mean we then also corrected our terminology these computer components they are all called nodes and we will be talking about nodes and then we also talked about the four main characteristics of the network which is a size which we measure as van land etc. topology like various types of topology various types of configuration how they are all connected physically and then there is a physical characteristic also which is what kind of wiring is used whether it is fiber channel whether it is copper we do it in terms of n-base T or under base T kind of measurements and then finally the protocol essentially how they talk to each other which is TCP is one of them duty to the other one so we talked about this and then one of the concepts that we introduced during this lecture was open systems interconnection model or OSI which divide the whole networking into the seven layers form with varying degrees of complexity the application layer where you have a complete disability of the application there you are launching the program you are sending the program to a particular network and then once that program is going to decide to send and to hit the send button how they it is then transmitted that is what the OSI deals with like the various layers or the presentation layer then then it goes to the session layer and then it is the transport network data link and then the physical physical is there the actual communication happens to the wires and basically the bits are transmitted and we do not even call it bits basically the voltages in fact way of looking at OSI from the bottom to the top which is the normal way that people always try to teach because it is easier to understand that way so you talk about like how the bits are transmitted like voltages then the data link layer which essentially forms the framing of the data then it goes into the network layer where basically it has the IP forwarding also built in and then it goes into the transport layer which is which offers the end to end offers end to end reliability of the system and then the upper layers are the session there and presentation and application there the data is aggregated more and then when it features the application it you know the computer actually sees the complete picture all the full data set all the settings everything like I mean it eliminated and all the data so example we also talked about how the OSI model differs from TCP IP the TCP IP the top three layers are combined in one and then essentially the all the the upper-level applications like mail web etc they reside in the application layer and then progressively like I mean you add bits basically break up the data and then you put how you broke up those kind of roadmaps into those broken up pieces and then send as piecemeal into the various layers below and then the layers below then they can communicate we also saw like 16 or essentially like five words sorry six 32 bit words which constitutes the IP header which is used by the IP layers essentially like that is the network layer to forward the messages and then we also saw like I mean how the various points differ essentially like how a host is different from a router and how far higher the chain that the message has to travel before it is distinguished and then it is out to the appropriate destination so we saw some of those examples I also wanted to put this picture here which kind of summarizes all our discussions so far as you know like I mean the Ethernet layers of the lower most layers which then the this is the link layers essentially which goes into the the network layer which is the IP layer and then you have the transport layer to the TCP layer so these are all buried under the bottom of the chain whereas the tunnel actually like has all these things all these correspond to the the terminal side and then the user just sees the top level and we also saw an example of a client server architecture there the client opens up some communication channel it actually opens up something called a socket when it so essentially like the server creates a socket it binds an address to the socket and then it basically waits at the point whenever the client wants to communicate client also creates a socket and these sockets are matching so basically you can connect and once it sends that message to the appropriate socket and the server has the socket it sends a sends back another message to accept that socket at that point the connection is made and then the packets are sent one by one into the server and then so services and then it sends back those packets as well so send and receive those hand-in-hand this simple client server model is used in many applications one of the key things that we learned was also the HTTP how we open up a website or essentially that will be make a server service request how that gets gets into the server and then how server services that is so in the data centers you will find this a lot in fact one of the structures of the data center is that basically they also divide into layers there there is a specific HTTP service layer and then followed by an application layer and then followed by a database there which all of them work hand-in-hand to provide the best service possible for the user so that is the the big introduction today I am not going to ask you to do any any exercises or activity we will all we will combine a lot of new activities into one big lab for this session today the main topic is going to be the IP addressing this is one of the topics I think is important from a general understanding perspective mainly because as the VLSI designers you will be in situations where you have to make sure that how to debug a network and probably you may have to also correct some of the issues that are in the network and all of them like by remotely logging in and then also even do some little bit of system administration again as I mentioned earlier this entire course is not to make you a system administrator this still focuses on the usage of the systems so we will only be doing that but I still wanted to give you like a little bit of basics on the IP addressing so that you are well-prepared like I mean if somebody says that hey this is your network address or this is not working or the subnet is not working something like that then you know what they mean and how you can give them that information so with that introduction let's go into the IP addressing so the first question that we ask is what is the purpose of IP address what do we need IP address so IP address is unique identification of the source so sometimes like you can use it for security and policy based filtering of data what this means is you can avoid certain or you can bounce back certain sources of there from there the service request is coordinating the other one is when many originates from a low-level server or high-level server based on that you can set priority and we can set what which data needs to be taken in and which data needs to be and then the IP address also provides a way to uniquely identify a destination so that the networks know where to send the data to so you need to have an IP address to receive the data while as a receiver of data you will be checking the IP address of whichever the message that is coming so in fact the network administrators use the IP address in very effective way this way they try to block certain network they identify the networks based on their IP address so that they can put it in the block table so that even if you try to go there they can block it typical example as you know like on-site and things like that basically there you cannot get into like from a public computer or even like a work computer the reason is the IP department knows the IP addresses of those systems and then effectively block from any message is going to those. Usually this is an network independent format that is what you need so that it is not tied to a given network and one of the reasons why internet became popular is also because of this feature where it is not tied to any network any particular type of network so it is basically IP can be over anything so this is another key thing to remember so what does it do actually so look at that so the IP address identifies a machine connection to a network so whenever a network receives a message it knows essentially like I mean which machine actually works there are no like spurious request coming into the network which can be stabilized that motor when you move from machine to machine even like I mean physically moving a particular machine from one network to another network you it requires a change of the IP addresses so in fact this has become an issue because say like I mean now you actually change providers of internet service and then suddenly new provider comes in and then you have to now your IP address is all different and everything else is different that is okay but when you buy a new computer or when you change a router in your home system you don't want everything to be different so there are ways to actually also control this one there is like dynamic IP allocation that's what most of the internet do because they know that the service is to just one more but inside that node if you change anything they they don't really want to know because they are as long as they can uniquely identify that it is you who is originating all the messages they are okay with it so this dynamic IP addressing actually has become pretty popular so up to your point it may be a static one but then inside that you can make it into a dynamic and then TCP IP users you need the 32-bit address and let's look at how they use this 32-bit address in the next slide so it is a 32-bit number divided as four active number so it is 8 bits so the the representation will be like and say 133.27 162.25 that is that is one IP address so that is the digital representation in binary you can also like represent this into the following here you can say basically that it is 10000 0101 so that represents this 133 it is a single number and then 27 is represented as the 11011 and then 162 is again 101 000010 and then same for 125 it is 0111110 sometimes this is also represented in hexadecimal for example the same number can be like 851b a 270 in Linux systems typically like I mean people represent their IP addresses in the all out IP addresses in the hexadecimal in fact there are some commands which we will talk about in the later part of this lecture the commands to get data from the from your machines and see like I mean how they are represented so we will talk about that later so now let's look at how these IP addresses are allocated as I already mentioned there is a static IP address which is what was very very prevalent until they ran out of the address space and then they started doing this dynamic and then dynamic also used to solve certain issues where the providers don't want to know like I mean how many how many computers are connected to the network I mean they want to know like I mean terms of the number but they don't really care which ones are connected today in a typical home you can find up to like maybe 10 devices connecting into the internet in various forms sometimes I mean they are all like connected together very easily like I mean you can found your TVs where the TVs are connected your all your mobile phones are connected the computers are connected printers are connected I don't know maybe even like your alarm clock whichever one you can think of they can easily be connected to the network via network storage is another big thing right now so that is another attached story so now if you add up all these things 10 15 easily it will cause that number and so the key question is how do you provide the unique addresses to all of them so let's look at how that is done the how the IP addresses are allocated so here actually like I mean there can be like two different IP address structures one is the private IP address they range from 10 to 8 essentially like I mean 10 or 8 and then like 10.000 10.0.0.0 to 10.255.255.255 which is the maximum 8 bit number and also like I mean the other one is 192 and 168 192.168 or 16 that is another set of private IP addresses and then 172.16 and that is another one too so here it is listed here basically like 192.168.0.0 through all the way and then this 172.16 that is again goes to 172.31.255 so this IP address ranges essentially like I mean so you can look at your machines inside the network they will all have like these IP addresses like 192 or 172 but the public address space is mostly like I mean there are many authorities assigning these numbers some of these authorities are this right here in afrinic etc or there are local internet registry also known as LIRs in United States there are several companies which allocate this addresses right now like I mean even like new companies have started so essentially like your provider actually like has taken a block of address from one of these authorities and then they start allocating it to their customers as well so essentially like I mean the bottom line is you have a small block from whatever range that you have and you subnet your networks so essentially and think of the larger internet as a hierarchical element there you may just get like one address space and then basically make that one from one address you create a subnet which has more of them so and then you create the subnet subnet and then you take that wider so once you have this thing like I mean you don't have to work as that with wide range essentially so so now let's look at how do we address in the internet works the the problem that we face is essentially like I mean now we have more than one physical network because there are all the subnets and they are in different locations large number of computers so we need a structure in the idea so to define the structure we need to have one portion which defines the network or the network part this defines which identifies which network in the internet work that this belongs to which is basically the internet and then the second part of the address is the host that identify the host on that network so every network has an address that's what this the first part is and then the second part is okay in this network where does this host it in so now we talk about the 32 bit now this how do we divide this into hierarchical IPSS hierarchical division so the network part defines the physical network that it belongs to and then the host is identified which is the whole that is connected so here like I mean we saw that in the previous slide there are these four numbers the the updates basically the first three updates now determine the the network and then the last one determines what the host is so essentially like I mean even though like I mean we talk about this the boundary can be really anywhere may not be like even a multiple of with bits because you run out of the address space or the original ones we can actually collect it more to the host if there are more hosts and that how we determine what is the the the network part and what is the host part is the is by using a network mouse so let's look at what the network mask is the network mask help define which bits are used to describe the network part and which are used for the host so there are different representations again for the network mask you can define the network mask as just a decimal dot rotation which is 255 255 224.0 this is one of the examples so here you can see that actually like the the network is up to here that is the first 8 16 the 21 sorry 19 bits and then the remaining all the zeros are the host part so the 19 bits first 19 bits represent the network and then the remaining ones in this 13 bits represent the host address binary form that is what shown here and then the hexadecimal if you can describe the mask this is e000 so typically like I mean your network will once it assigns the once you become a part of the network when the host whatever your machine parts becomes a part of the network the network will assign a mask essentially based on how many computers in the network are in the network based on that it assigns a mask and then the way that we generate the IP addresses is just a simple binary and of the 32 bit IP address with the 32 bit net mask and then we get the the network part of the address so here a simple binary and will provide the first 19 bits which is essentially the network and then the remaining ones will be the host so you can use this simple and function to actually separate out the network and the network address and or metro verification and the host and let us look at the class less addressing IP address with the subnet mask defines the range of addresses in the block essentially so so once you have these subnet mask essentially like I mean the 10.1.1.32 or 28 that defines the range from 10.1.1.22 to 10.1.1.47 with the above subnet mask so here the 10.1.1.32 is the network address and then the 47 becomes the broadcast address and then the 33 to 46 the range in between they can be assigned to other hosts or as an address space actually this we can be assigned as a network addressing network addresses that you can so now let us look at how the computers forward the packets based on these addresses so then the the packets are received the computers can only send packets directly to other computers only if they are on the subnet if the destination is not part of the subnet which is identified by the the network address then they are sent to a gateway the gateway is kind of you can think of as a central router and that actually sends it to the other networks so gateway is something that communicates between the two networks and then within the network the packets can be sent directly and then the default router option in slash etc slash RC dot on pick on text the default gateway for the system so this is one thing that you can find out you can do a lesson this file to see where is your default gateway and what and what is the mission and then basically like I mean IP forwarding on a free DSD box this is turned on with the gateway enable option in the etc of the dot one otherwise the box will not forward the packets from one interface so let us look at the DNS itself DNS is what is the domain name system there the computers use the IP addresses but the again like I mean or humans it is very hard to remember those IP addresses so DNS provides a reverse mapping of the IP addresses to the machine names and vice versa I mean actually like it goes both ways so this is something that basically we can look into and then we can see like what is the domain name of a particular I think or if you have a domain name then you can also come out of the address of that so this is the one this is one of the list there when the computers are moved between the networks the IP addresses will change but their domain names are the names remain the same so like I mean we saw like cat for whatever the name of the machine so that always remains the same in whichever network that goes into so the way that we keep it that way is to use a domain name system file so the DNS file if you look at it that will have the name listed and we can easily see that I mean what is the particular computer this particular machine so let us look at some of the useful commands that we can use to navigate the network here I am actually talking about you the commands again the commands actually follow the same higher same syntax that we all have all up familiar with right now which is the command name followed by argument followed by sorry command name followed by options followed by arguments so the first command is ping command ping is used to send this ICMP echo request to network calls so essentially it is actually a command by itself basically it instructs the receiving computer to send an echo of the ping basically so for example if you want to see the network if a particular machine is alive or dead you can use a thing and then you use the ping command to I mean all you send the ping command to that machine so that if the machine receives that ping command then it sends you back a message saying that hey I receive it so then you know that actually that machine is alive it is not this you can go on pinging for a while and then you know that either the network is having an undue delay or if that machine is machine that you are trying to reach is so typically we do this before we send an FTP request we studied the STP like last lecture which is the file transfer protocol for transferring files between systems and so doing that actually we will be studying in more detail in the next section as to how how STP can be done and what are the different configurations for STP but the bottom line is in order to the pin thing is used as a prelude to doing an FTP just so that I mean you can see whether the machine is alive then you can send the request next that is another command this prints out the network connections the routing tables the interface that etc we know that the there all these things all these terminologies we studied in the previous lecture the routing tables are the tables there the machine knows okay how the IP address for mapping and what are the total distances and so how to quickly reach the destination essentially like I mean if it receives the packet from this particular computer or this particular IP address what should be the next IP address those kind of that kind of information is in the routing table the network connections again it prints out the nearest neighbors who are all connected and how they are connected and also like the interface that like what kind of ports are open there which ports can be used for communication things like that if config is a command that is used for configuration of networks so in if config actually you can configure the network interpretation there are good examples if you do a man or config you should be able to get a lot of good information about this trace route is a command to print the route that packets are taking to the network host so as you know like the internet itself is the big aggregation of the network hardware connected together by various gateways we saw the gateway example on the machines so the tracking the the route that some packet is taking some packet is following it may be like very difficult so here essentially like I mean though this uses the IP protocol time to live field one of the field that we talked about when we talked about the IP address itself and then it from there it attempts to see like the response from each of the gateway along the path so that it understands what the path it takes to reach the destination so here essentially the the mandatory parameter is the destination host name or the IP address the IP number all the other ones basically you do not have to specify can assume some default and give you the usually it also sends out a probe data gram we know like what the data gram is essentially where we specifying the IP layer and below that data gram is typically 40 byte data basically but given like the I mean if it is more than sometimes it can be increased by specifying a pocket name so again I will ask you to just do a man of trace route to get like more information regarding the usually it gives you like I mean a bunch of posts it gives you the various it gives you as a DNS table essentially so it gives you the host name and its IP address and then it also gives you like I mean how much time it is taking like I mean how many hops each one is taking and then what are the what is the time that it is taking each of the the host so some of the the LSS based commands these commands are to call out certain things and to understand certain functions essentially then the last command that we will talk about is the TCP dump TCP dump dumps the traffic on a network again this it the TCP dump actually prints out the headers of the packets on the network network in the face that match the Boolean expression so you can also like give this Boolean expression again this goes through like I mean the same the options followed by the options followed by the argument here essentially like I mean specified options and then it it dumps out that TCP dump may not be a command that you can actually run it unless you have a super permission or a system administrator permission but you can still type man TCP dump and see like I mean what it generates it should generate whole bunch of information essentially so and there are various modes that you by which you can dump information so if you want to print all the packets are in at a destination you can give the PCB dump on that particular host and then you can also say like I mean okay you want some differential differential packets only like show certain things or you can also say like okay this I want to see whether what is the traffic between two holes so again these are the commands that are mainly used by the system administrators to troubleshoot a lot of these issues I just wanted to give you a flavor of how they do it and then what kind of thing goes on underneath I hope this is useful for you again I think this is pretty much the end of today's lecture we will be picking up from this point in the next one again to summarize today we mainly talked about the IP addressing talked about the how the IP addresses are formed why the IP addresses are needed the 32 bit IP address there is also the address of the IP address of your computer which essentially constitutes two pieces of information one piece of information is the subnet where it belongs to address of the subnet and then the second piece is its own post ID inside that subnet and even though this is represented as 4 8 bit numbers or 4 actual numbers in reality the the network address could be some bits of information and then the post ID can be different set of bits they all need to add to the 32 bit but inside the 32 bit however partition is up to you and so typically like that is determined by the subnet mask that we talk about the network mask essentially like by just looking at the network mask you can figure out how many bits are the addresses how many bits are the part of the network address and how many bits are part of post address so this I hope this is useful and then we also saw some commands towards the end as how the system administrators use these tools effectively to manage the system again I just wanted to just remember if you remember one command that is the pink command which you will be using many more times all the other commands are very very sparingly used by us in this in our field again thanks a lot thanks for listening we will pick it up from pick it up from this point and in the next lecture thanks once again.