this is bill farmer again welcome back to mcmaster university course computer science 1jc 3 introduction to computational thinking today we're going to start a new topic called the world wide web we're going to start by talking about the client server model this is a model for organizing services across the network so in this model we have two kinds of processes servers and clients the servers are processes that provide services over a network and the clients are processes that utilize services over network they utilize the services provided by the servers now servers listen at some particular reserve tcp or udb port or in some cases both port kinds of ports listening means they're waiting for requests that come to those ports they may participate in more than one tcp connection at a time and these servers are sometimes called often called demons and then in that case their name ends in a d so it looks like this so the client would be call http and this server would be httpd now servers can be organized as actually a group of processes or threads you often need a group of processes or threads because the server will handle multiple requests simultaneously now the clients as i said are processes that utilize the services they cut initiate connections to the servers they ask for service and they are usually assigned an ephemeral port so an ephemeral port is a port that the operating system just hands to the client it's used at that moment as opposed to a reserved port is a particular port that is given to the server on a permanent basis generally speaking servers are much more complex than clients and the burden of security falls mostly on the server if you want your application to be secure it mostly involves making sure that your server works in a secure way so if you're setting up a client server application these are the components that you need you need a communication protocol for web services for instance that's http uh you need a running server program for web servers services that's a web server and you need more one or more clients running client programs for web services that's a web browser and then you need to set up communication channels either via tcp or udp and usually you have a channel one channel from a client to a server but you could have in some protocols you could have multiple channels okay so the next thing we're going to talk about is cloud computing so what is cloud computing so cloud computing is using data storage and computational resources that are provided by servers on the internet and usually you have to pay to have access to these servers and they replace in-house computing services that an organization or a company would have and it provides a way of sharing infrastructure among many clients so the same infrastructure could be used by a variety of different clients a variety of different organizations or companies and this cloud computing provides various kinds of services you can store data you can have access to particular software this is called software as a service you can have access to a virtual computer this would be platform as a service or you can have access to the ability to create virtual computers as you need them this is called infrastructure as a service so cloud computing has certain advantages over normal computing it reduces personnel capital investment if you use cloud computing you don't have to buy and m and maintain and manage your the the server hardware because that's in the cloud someone else is doing it for you so you have reduced management costs uh you can have more and better quality of services so it has all these advantages the disadvantage is you're depending on someone else for privacy and security you don't have the same kind of management control that you would otherwise have and because everything is being done over the internet you have reduced computational speed okay so i have a question here for you this question is the internet is a blank virtual computer network and your choices are connectionless connection oriented both connectionless and connection oriented or none of the about so i'll give you a moment to answer that question okay welcome back the answer is both a and b depending on what layer of the internet you're looking at so let's review the internet layering model so here are the layers we have hardware the network interface this is the layer that connects layer where we can talk about how hosts are connected to physical networks we have the internet layer the transport layer and the application layer at the internet layer at this layer the internet works as a connectionless network at this layer works as a connection oriented network so at each layer we have different data units at the hardware we have some kind of signal that could be a microwave signal or electronic signal at the network interface we the data unit is a frame and at the internet level it's an ip datagram at the transport level it's either a tcp segment or it's a udp datagram and then there's many protocols but here are some of the main protocols at the network letter we have arp arp allows us to match up physical addresses with ip addresses and at the internet level we have ip and icmp ip is the main protocol icmp allows us to deal with problems that we have in using ip and then for transport we have two versions tcp and udp tcp provides all kinds of reliability udp provides no reliability and then we have various application protocols like http for web services and then for addressing we have at the network interface layout level we have physical addresses what kind of addressing depends on the kind of technology for the underlying physical networks at the internet level we have ip addressing and for the transport level we have protocol ports okay so the next thing i want to talk about is the domain name system so if we just go back up here we see we have an addressing system at the internet level this allows us to assign names to network interfaces and these uh names allow us give us a way of identifying hosts on the internet and we talked about how these addresses are 32 bits divided into four octets if you look at an ip address it really doesn't tell you much it's just four different numbers and so they're not very useful for communicating to people you know which machines are which machines so we have another system called the domain name system and this is a system for providing names for hosts as well as collections of hosts and it provides a way of mapping host names ip name addresses and vice versa you can map ip addresses back to host names you can also give alias aliases to host names so for instance many computers have a particular name and if they're using being used as your web server they have another alias that starts off with web actually now web www usually could be wet but www maybe i'll make that clear so it starts off with wwe and then the rest of the name and there's also information that could be stored with hosts and collections of hos like the mail exchange servers that particular hosts are using now this big domain name system it's managed by a set of name servers and each of these servers is responsible for some part of the system and the name servers communicate with each other using both tcp and udp and the name servers do lookups by a recursive search they basically look through their data and if they don't have the information they need they will ask other servers to look for information and look help them look up what they're looking for and sometimes this can start at a root server a root server is a name server for the whole domain name system and there are several root servers scattered across the internet uh now one thing that happens is when answers to name lookups are found these names are also often cached that way you don't have to go through this recursive search over and over again once you've found the information it's cached locally and you can use that now domain names consists of sequence of labels separated by dots now the first thing to know is ip addresses are numbers separated by dots but the domain name has generally its structure has nothing to do with the structure of ip addresses so domain name looks like this and each suffix is also domain name so this is also domain name and so forth every suffix is a domain name and the whole name here is a subdomain of its suffixes and so a domain name is a name for an individual host or it's a name for a group of hosts so just by looking at the name sometimes it's hard to tell whether it's a name domain name for a collection of hosts or a single host so for instance my my web server machine which is called high glac its name is heidel ack.cas dot mcmaster dot ca and if we look at this this is a domain name that's basically roughly speaking the domain name for canada this is the domain name for the machines at mcmaster this is the domain name for the machines in the department of computing software and finally the name of my machine is high glac an interesting thing about this machine is it is a virtual machine there is no hardware machine running but there is a virtual machine okay so this is how domain names work and there's some particular top level domain names like in this case let me use a different color this is the top level domain name that's always the one that's first on the right that's the top level domain name and these top-level domain names come in three kinds of the generic top-level domain names country code top-level domain names and there's infrastructure top level domain called arpa which is just for network structural use now originally there were six generic top-level domains com net org edu gov and mail and these were basically used by the united states mill was us military gov was u.s federal government edu or u.s educational institutions com or u.s companies net were organizations connected with the internet and org or miscellaneous organizations and the interesting thing is when i worked in industry i worked at a company called mitre.org that was its domain and at the time there were very very few domains in org org was pretty well empty at the time this would have been back in the 80s okay well things have changed quite a bit since these original six now what we see are we they've been expanded i guess people thought it wasn't fair that these were being mostly used by the us so they've been expanded and now there's all kinds of these there's basically over 1500 of them there was a lot of arguing at first about them but now it's it's pretty free there's a lot of these of all different kinds now in addition to these there are the country code top level domains there's 312. these are codes of particular countries like there is cas d e for germany uk for the united kingdom us for the for usa often when you see something like this it will mean that it's at the state level if it's at the national level it might be something like this or something like this but it could work both ways now eu is the country code for the european union even though the european union is not technically a country okay uh we're going to stop here and we're going to continue next time talking about where the world wide web came from