this video is part one of a three-part series discussing internet structure in this video we look at the tcp ip stack dns and protocol layering [Music] the internet is the most well-known wide area network or one it's essentially nothing more than a collection of interconnected networks routers cables satellites and other hardware spanning the world remember the internet is not the same as the world wide web which is simply a service that runs on the internet here is a home network connected via typical wireless router the router is connected to an internet service provider typically via telephone connection or fibre optic the isp is further connected to a domain name server and other routers that make up the backbone of the internet those routers are also connected to devices on their own lands other routers on the one and servers now there's quite a high degree of complexity involved when networking computers together some of the factors that have to be considered are shown on the screen now and as you can see it's not a simple process getting two devices to successfully network and be able to communicate because of this we employ protocols which we covered in the previous video a set of standards that allow two devices to communicate we deepen that understanding here by letting you know that protocols are broken up into what are called layers now this concept of layering is to divide the complex task of networking into smaller simpler tasks that work in tandem with each other the hardware and or software for each layer has a defined responsibility and each one provides a service to the layer above it the advantage of layering protocols is it helps to reduce a complex problem into smaller subproblems specific devices can be manufactured to operate at a particular layer and it means therefore that products and different vendors will now work together tcpip is one of the most important protocol stacks in use today the tcp stack refers to a set of networking protocols consisting of four layers working together all incoming and outgoing data packets pass up and down through the various layers of the tcpip protocol stack now before we dive into the rest of this video you might hear some people saying but the tcp model has five layers so the original tcpip model did have four layers the updated model has five breaking the link layer into two data link and physical there were very few physical connection options when tcpip was originally conceived now we've got twisted pair wi-fi fiber optic and many many more originally it didn't make a lot of sense to split physical connections from data delivery today it makes a lot more sense to do so now as the four layer model is perfectly sufficient for a level and the sort of questions you'll get in the exam we're going to stick with it for the sake of simplicity so let's have a look at the four layers of the tcp protocol model top layer is known as the application layer and we have protocol rules here that deal with network applications such as web browsers or email programs it's the actual applications at this layer so it's things like ftp web protocols like http and email protocols such as smtp the next layer is called the transport layer this sets up communication between two hosts they agree settings such as the language and the packet size this is where protocols such as tcp and udp live next we have the internet layer this layer is responsible for addressing the packets ready for data transmission and also route packets across the network this is where the ip or internet protocol sits and finally we have the link layer this is where network hardware and connection port status live operating system device drivers also sit here and this layer is actually responsible for facilitating the transmission of binary via any media whether that's copper cable fiber wi-fi or others okay so we're actually going to demystify this process a little bit now and we're going to see what happens when we try and send the message at the top of the screen computer system analysis is like child rearing you can do grievous damage but you cannot ensure success we're going to pass this message down through the layers of the tcpip stack to see what happens to each stage before it's sent to another device via network so the first thing is the application layer is hit and it has to use an appropriate protocol relating to whatever application is being used to transmit the data now this mesh is being sent via the web browser so the list of appropriate protocols would include http https or ftp and here we're using http so it adds a header onto the message now this message and the header combined is called a segment and we now pass it down to the transport layer which is the next layer in our stack it's here where we use the tcp protocol and other conversation protocols like udp it's responsible for establishing an end to end connection and maintaining conversations between application processes these protocols use port numbers to track sessions and so we add this information to the header once the connection is made the transport layer splits the data into separate packets and to each packet it adds a number or sequence the total number of packets and the port number that the packet should use the packets are numbered so they can be reassembled in the correct order at the other end because as we'll see later on in another video packets can arrive out of sequence our packets now arrive at the internet layer and this uses the ip part of the stack it now adds to each packet the source ip address and also the destination ip address all routers operate at this layer and they use the ip address to find out where the packets are heading we now have what's known as a socket that's the ip address plus the port so we now know the device the packet is being sent to the ip address and the application on that device that needs to pack it the port we finally pass these down to the link layer and this represents the actual physical connection between the network devices at this layer the packets are now referred to as frames this layer is responsible for adding the unique media access control on mac address and it adds it for the source device and the destination device when transmitting data between routers over a wide area network the mac address changes at each hop on the route now we're just going to pause a second having worked our way down the stack you may be wondering why we need two different types of addresses mac addresses and ip addresses so communication between two devices on the same local area network or lan only require the link layer which creates a frame using mac addresses communication between two devices on different networks while one requires both the network layer which uses ip addresses threaten packet and the link layer frame in practice communication via modern lands also makes use of ip addresses treating the local network as if it were a wide area one think of it another way every physical device should have a unique mac address however for a router storing the references to every mac address in existence would be unmanageable it would take too long to find a particular address to decide which connection to root traffic down therefore switches learn and store mac addresses for connected lan devices only while routers cache some ip addresses in essence it's quite similar to how we would address a letter your mac address tells me who you are your ip address tells me where you are say you want to send a message to another device on a local area network you don't know which one it's perfectly fine just to use the mac address at this level think of it like being in a classroom you want to talk to sarah but you don't know who sarah is you can simply call out or broadcast to the rest of the class who is sarah everyone hears your broadcast but only sarah replies sarah has in essence giving away who she is her mac address note that the mac address needs to be unique otherwise what would happen if there were two or more series this approach can't possibly work on the internet because there are far too many devices using our analogy sarah won't even be able to hear you you can't simply broadcast out to the whole world in the hope that sarah would respond in essence the ip address tells us roughly where we need to head even if we don't know the specific person or device our message is for now although this example is highly abstracted it helps to explain why we need both a mac address and an ip address to root traffic over a wide area network such as the internet so if two hosts are on the same network delivery as we said is simple one host can simply send to the other a host may need to broadcast first if it doesn't already know the destination or mac address and the art protocol achieves this as traffic passes through the switch the switch examines the source and destination mac address and learns which address applies to which device eliminating the need for broadcasting in the future modern routers are both routers and switches performing both lan switching and wan routing if the hosts are on different networks for example sending something over the internet the data will be transmitted via a router the destination mac address will be the address of the router when the frame reaches the router the router works out where it needs to send the packet by looking at the destination ip and the header the router then sets its own mac address as the source and the next device as the destination the router can also use the arc protocol to find the destination mac address if the router doesn't already know it if there are several routers on the path to the destination the source and the destination mac address will be overwritten at each hop on the journey the original message is split apart and wrapped up in segments these segments then wrapped up in packets which are turned and wrapped up in frames once the frames reach their final destination they will travel up through the layers of the tcp stack in reverse order stripping off the headers and tails as they go and finally the destination application receives the original message so moving away from tgpip you also need to understand a bit about the world wide web and how it uses the domain name system so the world wide web is a collection of files and information stored in hypertext known as web pages and other associated files hosted on web servers these web server hosts store the files and handle client requests for example a http get request for a page or resource a web page stored as text is sent to a web browser application which uses rules to render it correctly so let's look at it from a top level a user requests a url for a browser and these are user-friendly so things like bbc dot co dot uk the browser sends the domain name to the domain name system the dns maps the domain name back to an ip address and returns it to the browser a get request from the web page or resource can now be sent to the web server using the ip address even though you typed in a human-friendly url and finally the requested web page or resource is returned to the client's web browser now the domain name system is actually a little bit more complex than this so let's look at it in a bit more detail so here we've typed in the human readable url www. google. com into our browser and it's received by the domain name systems resolver server the server then queries a dns root name server the root server responds with the address the top level domain server so for this it's dot com the resolver makes requests to the dot-com tld server and this server then responds with the ip address of the domain's name server google.
com the recursive resolver sends a query to the domain's name server the ip address of google. com is then returned to the resolver from the name server and finally the dns resolver responds to the web browser with the ip address google.