O pen Learn W orks · 3 IPv4 address structure 5 4 Assigning IPv4 addresses 11 5 Using DHCP at home...

19
Data networks and IP addresses

Transcript of O pen Learn W orks · 3 IPv4 address structure 5 4 Assigning IPv4 addresses 11 5 Using DHCP at home...

OpenLearn Works

Data networks and IP addresses

Contents1 Network communication 32 Network addressing 43 IPv4 address structure 54 Assigning IPv4 addresses 115 Using DHCP at home 126 Using DNS at home 147 Data networks and packet switching 158 Activities 189 Additional resources 1810 End of course quiz 1911 Acknowledgements 19

2 of 19 Monday 4 September 2017

1 Network communication

l Communication begins with a message, or information, that must be sent from oneindividual or device to another. People exchange ideas using many differentcommunication methods. All of these methods have three elements in common:1 The first of these elements is the message source, or sender. Message sources

are people, or electronic devices, that need to send a message to otherindividuals or devices.

2 The second element is the destination, or receiver, of the message. Thedestination receives the message and interprets it.

3 The third element, called a channel, consists of the transmission media thatprovides the pathway over which the message travels from source todestination.

Figure 1

l Consider, for example, communicating a message using words, pictures andsounds. These can be sent across a data or information network by first convertingthem into binary digits, or bits. The bits are then encoded into a signal that can betransmitted over the appropriate medium. In computer networks, the media is usuallya type of cable, or a wireless transmission. A transmitter is used by the messagesource to place data onto a transmission media. A receiver is used by the messagedestination to recover data from the transmission media.

l The term ‘network’ in this course refers to data or information networks capable ofcarrying many different types of communications, including traditional computer data,and interactive voice, video and entertainment products.

l Traditionally, the sources and destinations within information networks werecomputers, but today there are a wide range of devices capable of exchanging data:l smart phonesl tablet computersl carsl domestic appliances.

l The transmission media can be either guided or unguided.l Examples of guided media include wired technology such as:

l coaxial cable (e.g. cable TV systems)l unshielded twisted pair (e.g. DSL broadband)l fibre optic (e.g. high speed cable systems).

l Examples of unguided media include wireless technology such as:

1 Network communication

3 of 19 Monday 4 September 2017

l WiFi (e.g. home network)l cellular (e.g. 3G, 4G, 5G mobile phones)l satellite (e.g. television).

l The media chosen will determine the type of transmitter and receiver required.

2 Network addressing

l When a ‘message’ such as a file, image or video is transmitted across a network, it isfirst broken down into small blocks called segments. These are placed intocontainers called packets, typically by the Internet Protocol (IP). There are twoversions of IP: version 4 and version 6.

l IP is responsible for delivering the packets from source to destination, andregardless of the version being used, packets must use some form of addressing touniquely identify the message source and message destination.

l This is very similar to the way that you address a letter that you send through thepost. When you send a letter, you normally write the address of the recipient(destination) on the front and your own address (source) on the back.

l IP includes other information within the packets, including its size, and someinformation about the type of data that the packet contains (e.g. webpage, email).

l The information added to the data to create the packet is called the IP header. Theprocess of adding the IP header to the data is called ‘encapsulation’.

l Encapsulation is a complex term used to describe a simple technical process. Thinkof presents you may be given for your birthday – they are encapsulated in wrappingpaper. So, encapsulation is the thin, additional layer of information used to wraparound data when it is sent between computers.

l Continuing the birthday present analogy, many of you may have sometime in thepast played pass the parcel – a children’s game involving a present that has manylayers of wrapping. Similarly, networking has many layers of wrapping, orencapsulation, which are each used to help in the reliable transmission of data.

Figure 2

2 Network addressing

4 of 19 Monday 4 September 2017

3 IPv4 address structure

l IP and postal addresses are considered to be hierarchical, which means they containa structure. Consider a letter with the following postal address:

Mr Weyland

32 Colony Avenue

Hicksville

LV426

l The address identifies the house, street and town that the postal service needs touse to deliver the letter. It also identifies the person in the house for whom the letter isintended. This is very important, as the house probably contains a number of peopleand they need to be able to determine who the letters is for.

l Now consider an IPv4 address: 192.168.10.10l The address identifies the network that the packet has to be delivered to using

the ‘192.168.10’ portion of the address.l The identity of the device, or host, within the network for which the packet is

intended is ‘.10’.l Therefore, we can say that an IPv4 address contains a network and a host

component.l Because IP addresses are designed to be used by computing devices, they are

actually 32-bit binary numbers, which are converted to decimal to make them easierfor people to work with. To make the addresses even easier to work with, they aredivided into four 8-bit blocks called octets:

Figure 3

l The decimal numbers within each octet can range from 0 to 255.

Activity: Decimal and binary numbersYou need to be comfortable with converting between decimal and binary numbers. Tryusing the excel spreadsheet to convert the following decimal numbers into binary.

3 IPv4 address structure

5 of 19 Monday 4 September 2017

l decimal and binary conversion spreadsheet

Decimal Binary

2 Provide your answer...

4 Provide your answer...

8 Provide your answer...

10 Provide your answer...

24 Provide your answer...

32 Provide your answer...

48 Provide your answer...

64 Provide your answer...

128 Provide your answer...

160 Provide your answer...

255 Provide your answer...

192 Provide your answer...

168 Provide your answer...

l In the example above we used colour to identify the network and host components inthe IPv4 address, but this technique will not work for computing devices. Instead IPsubnet masks are used. The IP subnet mask is a 32-bit binary number, and eachbinary ‘1’ is used to identify a network bit within the IP address itself:

3 IPv4 address structure

6 of 19 Monday 4 September 2017

Figure 4

l Note that the subnet mask bits are set to ‘0’ to identify the host portion of the address.A computing device will evaluate the IP address and subnet mask together, bit by bit(this is called bit wise), performing a logical ‘AND’ operation:

Figure 5

l The AND function will take two inputs, and if they are both ‘1’, it will output a ‘1’. Anyother combination of inputs will result in a ‘0’ output.

3 IPv4 address structure

7 of 19 Monday 4 September 2017

Example: AND functionTry performing the AND function on the address and mask shown below:

Figure 6

l Proceed from left to right, taking 1 bit from the address, 1 bit from the mask andperform the AND function. The output will be the network address:

3 IPv4 address structure

8 of 19 Monday 4 September 2017

Figure 7

l Note that the network address is 192.168.10.0, not 192.168.10 as shown previouslyin the coloured example. This is because the network address has to be 32-bits long,but as it does not include any host information, the host component is set to the allzero condition.

l Now that you have determined the network address, you can assign individual hostaddresses to the devices in your network:

3 IPv4 address structure

9 of 19 Monday 4 September 2017

Figure 8

l Note that all the PCs in the figure above share the same network address, but haveunique host addresses. The range of possible host addresses is limited by thenumber of binary bits within the host octet, so in theory the range is .1 to .255.However, the .255 address is reserved for broadcast transmission, when devicesneed to communicate simultaneously with every host in their network, and cannot beassigned to an individual host. Thus, in this example, the range of possible hostaddresses is .1 to .254.

l You may have noticed that each device’s address is followed by /24. This representsthe subnet mask, which we have seen is very important as it defines which parts ofthe address relate to the network and host components.

l Writing the subnet mask out in full (255.255.255.0) can be quite repetitive, soinstead, you can state the number of bits within the mask that are set to ‘1’. As 255corresponds to 11111111 in binary, you have eight binary bits set to ‘1’ in the octet.With three octets set to 255, you have a total of 24 bits sets to ‘1’, thus the subnetmask (or prefix length) can be written as /24.

3 IPv4 address structure

10 of 19 Monday 4 September 2017

4 Assigning IPv4 addresses

l Devices need to be configured with an IP address before they can send and receivedata on a network. There are two ways of achieving this:l Manual: you access each device and assign an appropriate IP address and

subnet. This can be useful if you need an IP address that never changes, and istypically assigned to devices such as servers and printers. However, if you havemany devices, manual configuration can be time consuming and prone toerrors.

Figure 9

l Dynamic: you can employ the client/server Dynamic Host ConfigurationProtocol (DHCP) to automatically assign IP addresses to clients as they join thenetwork. Only the DHCP server needs to be configured with an appropriate poolof IP addresses, which it will assign to client devices as they join the network,

4 Assigning IPv4 addresses

11 of 19 Monday 4 September 2017

ensuring that the addresses are unique. DHCP is very useful when the networkhas many host devices and reduces the chance of errors in assigningaddresses.

Figure 10

5 Using DHCP at home

l Most large businesses and schools will use a dedicated server to provide DHCPservices, but in smaller networks the DHCP service is integrated within existingdevices.

l At home, your broadband or cable router will be providing DHCP services for all thedevices within your house. It does not normally require configuration, although youcan access the settings and make changes if required.

l Your home router needs to provide connection to two networks:l The Local Area Network (LAN): the network that contains all the devices within

your house, such as computers, tablets and smart phones.l The Wide Area Network (WAN): the network connecting to your service

provider.l For more information on LANs and WANs watch the following video.

5 Using DHCP at home

12 of 19 Monday 4 September 2017

Figure 11

l If you examine the network in the figure above, you can see that all the householddevices are part of the 192.168.0.0/24 LAN, and have received these addressesfrom the home router via DHCP. The home router also has an IP address within theLAN (192.168.0.1/24) – this is pre-configured by the device’s manufacturer, althoughit can be changed if required.

l The home router also has an IP address assigned to the interface connecting to theISP WAN. Note that this is in a completely different network (82.10.250.19/26). Thehome router will forward all the data packets from the LAN towards the ISP via theWAN interface to allow you to access Internet services.

l It is important for the devices in your LAN to know when they are sending packets toother networks. They achieve this by comparing their configured network addresswith the destination IP address of the packet they are sending. If the two addressesare in different networks, then the device will send the packet towards the homerouter’s LAN interface, which is referred to as the default gateway. The home routerwill then forward the packet onto the ISP via its WAN interface.

l The LAN devices learn about the default gateway via DHCP.

5 Using DHCP at home

13 of 19 Monday 4 September 2017

Figure 12

l The WAN interface of the home router can also be assigned via DHCP, but this timethe server is located in the ISP’s network, and it will assign a unique IP address toeach customer, as shown above.

l If all the ISP’s customers are using the same type of home router, then all the LANdevices will be receiving IP addresses via DHCP. This means that LAN devices willnot have unique addresses. This is a problem when using the Internet, as all sourcesand destinations must be uniquely addressed.

l This problem is solved by a process called Network Address Translation (NAT),which is performed by the home router. Packets received by the router from LANdevices will have their non-unique source addresses changed to a unique WANinterface IP address.

6 Using DNS at home

l When you are accessing the WWW from home, you may not be aware that you areusing IP addresses because you normally access webpages using UniformResource Locators (URLs).

l However, all the packets that are exchanged between your home device and the webserver require IP addresses to ensure that they are delivered correctly, so theDomain Name Services (DNS) is required to map between URLs and IP addresses.

l DNS servers contain these mappings between IP addresses and URLs. Thousandsof DNS servers, spread across the world, are required to support the operation of theInternet.

l In order for your local LAN device to access DNS, it must know the IP address of theDNS server that the local ISP wishes it to use. Once again this information is learntdynamically using DHCP.

6 Using DNS at home

14 of 19 Monday 4 September 2017

7 Data networks and packet switching

l You have seen that data packets are responsible for transferring data acrossnetworks, and require IP addresses to do so. The box below describes in more detailhow a PC uses packets to retrieve a webpage (without considering the actionof NAT).

How a PC uses packets to retrieve a webpage

Figure 13

l The user within the home LAN enters a URL such as www.bbc.co.uk into thebrowser on their PC, which has an IP of 192.168.0.101. The PC then creates anIP packet addressed to the local DNS server, as it needs to resolve the correct IPaddress for the BBC web server:

Figure 14

7 Data networks and packet switching

15 of 19 Monday 4 September 2017

l The packet uses the IP address of the home PC as its source and the IP addressof the DNS server as its destination. The packet contains a request from the DNSfor the IP address of the BBC web server. Note that the ‘type’ field of the packetidentifies the User Datagram Protocol (UDP), which is responsible for segmentingthe DNS request so that the IP can encapsulate it within a packet.

l The PC identifies that the packet is leaving the LAN, as the source and destinationnetworks are within different IP networks, so it forwards the packet towards thedefault gateway it has learnt via DHCP: 192.168.0.1, which is the LAN interface ofthe home router.

l The router examines its routing table, which identifies all the IP networks therouter can forward packets to. It is then able to identify an exit interface to use inorder to forward the packet towards the destination network identified in thepacket.

l The packet may be required to pass through multiple routers, but it eventuallyarrives at the DNS server, which examines the DNS request and identifies the IPaddress that maps to the URL. It then creates a new packet containing aresponse, which is forwarded back to the home PC:

Figure 15

l The packet returns to the home router, which forwards it to the PC. The PC nowhas the correct IP address for the URL it wishes to contact, so it can construct anew packet containing the web server as a destination and carrying an HTTP GETmessage requesting webpage content. Note that the protocol type has changed toTransmission Control Protocol (TCP). Like UDP it performs segmentation, butalso provides reliability mechanisms to protect against data errors if packets arelost or damaged during transmission.

7 Data networks and packet switching

16 of 19 Monday 4 September 2017

Figure 16

l Once again, the PC realises that the packet’s destination is not on the local LANand forwards it to the home router, which in turn forwards the packet to the ISPand onto the Internet via its WAN interface. The packet passes through severalrouters as it heads towards the web server, with each router checking thedestination address within the packet and forwarding appropriately.

l Once the web server receives the packet, it examines the GET message to seewhich particular page is required, and then returns the webpage as HTML within aseries of packets addressed to the home PC:

Figure 17

l The process explained above is facilitated by routers within both the home networkand within the Internet itself. Routers forward packets based on the destinationaddress they find in the IP packet header, and the information they themselves knowabout how to reach the identified destination.

l Routers store information internally about destination networks in tables called‘routing tables’. The process of accepting a packet on an incoming interface, makinga decision on what to do with it, and then sending it towards another interface is

7 Data networks and packet switching

17 of 19 Monday 4 September 2017

called packet switching. To learn more about packet switching watch the followingvideo.

l The networks which make up the Internet are complex, and there are often multipledifferent paths that routers can use to packet switch towards a destination. Whenfaced with multiple paths, routers are capable of deciding which path to choosebased on a variety of network characteristics, a process known as routing.

8 Activities

Activity: Tablets of stone – network communication protocolsComplete the classroom activity provided in the activity book, Tablets of Stone, whichsimulates a network distributing messages. It explores how information is added tomessages to ensure they are sent to the correct recipient, and looks at how this makesup a protocol.

Activity: Setting up the home network, IP and packet switching (PacketTracer)For most of us, internet connectivity starts in the home or school. This Packet Tracerlab is in several parts and explores IP addressing and packet switching in turn.You will also need

l Lab Book: Data Transmission Over Digital Networksl Packet Tracerl CASBIT_BUILD.pkzl CASWANT.pkz

9 Additional resourcesFor more information on the subjects covered in this course, download the DigitalSchoolhouse’s publication on Communications and Networks Unplugged. You canregister for free with the Digital Schoolhouse to access the resources needed for theactivities it includes. The following activities are particularly relevant to this course:

l 2. Understanding how data travel through the internet (page 16)l 3. Data transfer protocols (page 19)l 4. Packet switching (page 25)l 5. Understanding IP Addresses as unique identifiers (page 29)

8 Activities

18 of 19 Monday 4 September 2017

l 6. The Binary behind IP Addresses (page 35)l 10. How search engines rank the webpages into an order (page 49)

10 End of course quizNow it’s time to test what you’ve learned in a quiz.

11 AcknowledgementsGrateful acknowledgement is made to the following sources:Figure 1: CiscoFigure 2: Birmingham City University (BCU)Figure 3: Birmingham City University (BCU)Figure 4: CiscoFigure 5: Birmingham City University (BCU)Figure 6: CiscoFigure 7: Birmingham City University (BCU)Figure 10: Birmingham City University (BCU)Figure 11: Birmingham City University (BCU)Figure 12: Birmingham City University (BCU)Figure 13: Birmingham City University (BCU)Figure 14: Birmingham City University (BCU)Figure 15: Birmingham City University (BCU)Figure 16: Birmingham City University (BCU)Figure 17: Birmingham City University (BCU)Every effort has been made to contact copyright holders. If any have been inadvertentlyoverlooked the publishers will be pleased to make the necessary arrangements at the firstopportunity.

10 End of course quiz

19 of 19 Monday 4 September 2017