* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Dynamic addressing
Survey
Document related concepts
Network tap wikipedia , lookup
TCP congestion control wikipedia , lookup
Airborne Networking wikipedia , lookup
Distributed firewall wikipedia , lookup
Dynamic Host Configuration Protocol wikipedia , lookup
Computer network wikipedia , lookup
Deep packet inspection wikipedia , lookup
List of wireless community networks by region wikipedia , lookup
Piggybacking (Internet access) wikipedia , lookup
Wake-on-LAN wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
UniPro protocol stack wikipedia , lookup
Internet protocol suite wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Transcript
Local & Metropolitan Area Networks ACOE322 Lecture 5 TCP/IP Protocol suite and IP addressing Dr. L. Christofi 1 0. INTRODUCTION We shall cover in this topic: 1. The relation of TCP/IP with internet and OSI model 2. Internet layer 3. Transport layer and UDP 4. Application layer Dr. L. Christofi 2 1. History and Future of TCP/IP • The U.S. Department of Defense (DoD) created the TCP/IP reference model because it wanted a network that could survive any conditions. • Some of the layers in the TCP/IP model have the same name as layers in the OSI model. Dr. L. Christofi 3 Application Layer • Handles high-level protocols, issues of representation, encoding, and dialog control. • The TCP/IP protocol suite combines all application related issues into one layer and ensures this data is properly packaged before passing it on to the next layer. Dr. L. Christofi 4 Transport Layer Five basic services: — Segmenting upper-layer application data — Establishing end-to-end operations — Sending segments from one end host to another end host — Ensuring data reliability — Providing flow control Dr. L. Christofi 5 Layer 4 Protocols Dr. L. Christofi 6 Internet Layer • The purpose of the Internet layer is to send packets from a network node and have them arrive at the destination node independent of the path taken. • Internet layer protocols: —Internet Protocol (IP) —Internet Control Message Protocol (ICMP) —Address Resolution Protocol (ARP) —Reverse Address Resolution Protocol (RARP) Dr. L. Christofi 7 Network Access Layer • The network access layer is concerned with all of the issues that an IP packet requires to actually make a physical link to the network media. • It includes the LAN and WAN technology details, and all the details contained in the OSI physical and data link layers. Dr. L. Christofi 8 Comparing the OSI Model and TCP/IP Model Dr. L. Christofi 9 Similarities of the OSI and TCP/IP models • Both have layers. • Both have application layers, though they include very different services. • Both have comparable transport and network layers. • Packet-switched, not circuit-switched, technology is assumed. • Networking professionals need to know both models. Dr. L. Christofi 10 Differences of the OSI and TCP/IP models • TCP/IP combines the presentation and session layer into its application layer. • TCP/IP combines the OSI data link and physical layers into one layer. • TCP/IP appears simpler because it has fewer layers. • TCP/IP transport layer using UDP does not always guarantee reliable delivery of packets as the transport layer in the OSI model does. Dr. L. Christofi 11 Internet Architecture • Two computers, anywhere in the world, following certain hardware, software, protocol specifications, can communicate, reliably even when not directly connected. • LANs are no longer scalable beyond a certain number of stations or geographic separation. Dr. L. Christofi 12 2. TCP/IP Internet layer Internet Addresses Dr. L. Christofi 13 IP Address as a 32-Bit Binary Number Dr. L. Christofi 14 Binary and Decimal Conversion Dr. L. Christofi 15 IP Address Classes Dr. L. Christofi 16 IP Address Classes Dr. L. Christofi 17 IP Addresses as Decimal Numbers Dr. L. Christofi 18 Hosts for Classes of IP Addresses Class A (24 bits for hosts) 224 - 2* = 16,777,214 maximum hosts Class B (16 bits for hosts) 216 - 2* = 65,534 maximum hosts Class C (8 bits for hosts) 28 - 2* = 254 maximum hosts * Subtracting the network and broadcast reserved address Dr. L. Christofi 19 IP Addresses as Decimal Numbers Class D: Multicast Class E: Research Dr. L. Christofi 20 Network IDs and Broadcast Addresses An IP address such as 176.10.0.0 that has all binary 0s in the host bit positions is reserved for the network address. An IP address such as 176.10.255.255 that has all binary 1s in the host bit positions is reserved for the broadcast address. Dr. L. Christofi 21 Private Addresses These addresses are NEVER used on the Internet and should never appear on the Internet. They are used only for private networks. Dr. L. Christofi 22 Reserved Address Space • Network ID • Broadcast address • Hosts for classes of IP addresses Dr. L. Christofi 23 Basics of Subnetting • • • • • Classical IP addressing Subnetworks Subnet mask Boolean operations: AND, OR, and NOT Performing the AND function Dr. L. Christofi 24 Subnetworks • To create a subnet address, a network administrator borrows bits from the original host portion and designates them as the subnet field. Dr. L. Christofi 25 Subnetworks Dr. L. Christofi 26 Subnet Mask • Determines which part of an IP address is the network field and which part is the host field • Follow these steps to determine the subnet mask: — 1. Express the subnetwork IP address in binary form. — 2. Replace the network and subnet portion of the address with all 1s. — 3. Replace the host portion of the address with all 0s. — 4. Convert the binary expression back to dotted-decimal notation. Dr. L. Christofi 27 Subnet Mask Subnet mask in decimal = 255.255.240.0 Dr. L. Christofi 28 Boolean Operations: AND, OR, and NOT • Recall — AND is like multiplication — OR is like addition — NOT changes 1 to 0, and 0 to 1. Dr. L. Christofi 29 Performing the AND Function Dr. L. Christofi 30 Range of Bits Needed to Create Subnets Dr. L. Christofi 31 Subnet Addresses Dr. L. Christofi 32 Decimal Equivalents of 8-Bit Patterns Dr. L. Christofi 33 Creating a Subnet • Determining subnet mask size • Computing subnet mask and IP address • Computing hosts per subnetwork • Boolean AND operation • IP configuration on a network diagram • Host and subnet schemes • Private addresses Dr. L. Christofi 34 Determining Subnet Mask Size Class B address with 8 bits borrowed for the subnet 130.5.2.144 (8 bits borrowed for subnetting) routes to subnet 130.5.2.0 rather than just to network 130.5.0.0. Dr. L. Christofi 35 Determining Subnet Mask Size Class C address 197.15.22.131 with a subnet mask of 255.255.255.224 (3 bits borrowed) 11000101 00001111 Network Field 00010110 100 00011 SN Host Field The address 197.15.22.131 would be on the subnet 197.15.22.128. Dr. L. Christofi 36 Subnetting Example with AND Operation Dr. L. Christofi 37 IP Configuration on a Network Diagram The router connects subnetworks and networks. Dr. L. Christofi 38 Host Subnet Schemes The number of lost IP addresses with a Class C network depends on the number of bits borrowed for subnetting. Dr. L. Christofi 39 Broadcast addresses exercise Fill-in the class, subnet and broadcast IP addresses in the following table Address Subnet Mask 201.222.10.60 255.255.255.248 15.16.193.6 255.255.248.0 128.16.32.13 255.255.255.252 153.50.6.27 255.255.255.128 64.10.19.152 255.255.240.0 Dr. L. Christofi Class Subnet Broadcast 40 Broadcast addresses exercise answer Fill-in the class, subnet and broadcast IP addresses in the following table Address Subnet Mask Class Subnet Broadcast 201.222.10.60 255.255.255.248 C 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 A 15.16.192.0 15.16.199.255 128.16.32.13 255.255.255.252 B 128.16.32.12 128.16.32.15 153.50.6.27 255.255.255.128 B 153.50.6.0 153.50.6.127 64.10.19.152 255.255.240.0 A 64.10.16.0 64.10.31.255 Dr. L. Christofi 41 Exercise 1 • Given the IP address 192.168.100.86 find —The default mask —The subnet mask, assuming 5 bits of subnetting —The subnet IP address —The broadcast address —The first and last valid host IP addresses Dr. L. Christofi 42 Exercise 1 answer • Given the IP address 192.168.100.86 find —The default mask: It is a class C address, therefore Default mask is 255.255.255.0 —The subnet mask, assuming 5 bits of subnetting 5 bits for subnet, 3 remaining bit for host addresses, so subnet mask is 255.255.255.248 —The subnet IP address: 192.168.100.80 —The broadcast address: 192.168.100.87 —The first and last valid host IP addresses 1st valid host address: 192.168.100.81 Last valid host address: 192.168.100.86 Dr. L. Christofi 43 Exercise 2 • Given the IP address 172.16.164.32/19 find —The default mask —The subnet mask —The subnet IP address —The broadcast address —The first and last valid host IP addresses Dr. L. Christofi 44 Exercise 2 answer • Given the IP address 172.16.164.32/19 find —The default mask It is a class B address, so Default mask is 255.255.0.0 —The subnet mask: 255.255.224.0 —The subnet IP address: 172.16.160.0 —The broadcast address: 172.16.191.255 —The first and last valid host IP addresses 1st valid host address: 172.16.160.1 Last valid host address: 172.16.191.254 Dr. L. Christofi 45 IPv4 versus IPv6 • IP version 6 (IPv6) has been defined and developed. • IPv6 uses 128 bits rather than the 32 bits currently used in IPv4. • IPv6 uses hexadecimal numbers to represent the 128 bits. IPv4 Dr. L. Christofi 46 Obtaining an IP Address • Static addressing —Each individual device must be configured with an IP address. • Dynamic addressing —Reverse Address Resolution Protocol (RARP) —Bootstrap Protocol (BOOTP) —Dynamic Host Configuration Protocol (DHCP) —DHCP initialization sequence —Function of the Address Resolution Protocol —ARP operation within a subnet Dr. L. Christofi 47 Default Gateway A default gateway is the IP address of the interface on the router that connects to the network segment on which the source host is located. Dr. L. Christofi 48 3. TCP/IP Transport Layer Five basic services: • Segmenting upper-layer application data • Establishing end-to-end operations • Sending segments from one end host to another end host • Ensuring data reliability • Providing flow control Dr. L. Christofi 49 Flow Control • Avoids the problem of a host at one side of the connection overflowing the buffers in the host at the other side • Ensures the integrity of the data Dr. L. Christofi 50 Session Establishment Dr. L. Christofi 51 Three-Way Handshake Dr. L. Christofi 52 Windowing • A method of controlling the amount of information transferred end to end • Information can be measured in terms of the number of packets or the number of bytes Dr. L. Christofi 53 Window Size Larger window sizes increase communication efficiency. Dr. L. Christofi 54 Acknowledgment • Positive acknowledgment requires a recipient to communicate with the source, sending back an acknowledgment message when it receives data. • Sender keeps a record of each data packet that it sends and expects an acknowledgment. Dr. L. Christofi 55 Layer 4 Protocols Dr. L. Christofi 56 TCP • Connection oriented • Reliable • Divides outgoing messages into segments • Reassembles messages at the destination station • Resends anything not received • Reassembles messages from incoming segments Dr. L. Christofi 57 UDP • Connectionless • Unreliable • Transmits messages (called user datagrams) • Provides no software checking for message delivery (unreliable) • Does not reassemble incoming messages • Uses no acknowledgments • Provides no flow control Dr. L. Christofi 58 TCP/IP Protocol Graph Dr. L. Christofi 59 TCP Segment Format Dr. L. Christofi 60 UDP Segment Format Dr. L. Christofi 61 Port Numbers Dr. L. Christofi 62 4. TCP/IP Application Layer Dr. L. Christofi 63 Responsibilities • Identifying and establishing the availability of intended communication partners • Synchronizing cooperating applications • Establishing agreement on procedures for error recovery • Controlling data integrity Dr. L. Christofi 64 Application Layer Examples • Domain Name System (DNS) • File Transfer Protocol (FTP) • Hypertext Transfer Protocol (HTTP) and World Wide Web (WWW) • Simple Mail Transport Protocol (SNTP) • Simple Network Management Protocol (SNMP) • Telnet Dr. L. Christofi 65 Domain Name System (DNS) • To identify an entity the Internet uses the IP address, which uniquely identifies the connection of a host to the Internet • However, people prefer to use names instead of numeric addresses • Therefore we need a system that can map a name to an address or an address to a name • When the Internet was small, mapping was done using a host file • Today is impossible to have a single host file to relate every address to a name and vice versa. The host file would be too large to store in every host • One solution is to store the entire host file in a single computer and allow access to this centralized info to every PC that needs a mapping – but this would create a huge amount of traffic • Another solution is to divide this huge amount of info into smaller parts and store each part on a different computer. In this method, the host that needs mapping can contact the closest computer holding the needed info. • This method is used by the DNS system. Dr. L. Christofi 66 Domain Name System Dr. L. Christofi 67 FTP (1) • File transfer protocol (FTP) is a TCP/IP client-server application for copying files from one host to another. • FTP requires two connections for data transfer: a control connection and a data connection. • FTP employs ASCII for communication between dissimilar systems. • Prior to the actual transfer of files, the file type, data structure, and transmission mode are defined by the client through the control connection. • Responses are sent from the server to the client during connection establishment. Dr. L. Christofi 68 FTP (2) • There are three types of file transfer: — A file is copied from the server to the client. — A file is copied from the client to the server. — A list of directories or file names is sent from the server to the client. • Most operating systems provide a user-friendly interface between FTP and the user. • Anonymous FTP provides a method of the general public to access files on remote sites. Dr. L. Christofi 69 SMTP • One of the most important network services is electronic mail (email) • Electronic mail is used for sending a single message that includes text, voice, video or graphics to one or more recipients • Simple Mail Transfer Protocol (SMTP) is the standard mechanism for electronic mail in the Internet Dr. L. Christofi 70 SMTP • E-mail servers communicate with each other using the Simple Mail Transport Protocol (SMTP) to send and receive mail. Dr. L. Christofi 71 SMTP Dr. L. Christofi 72 HTTP • • • • • The Hypertext Transfer Protocol (HTTP) is used mainly to access data on the World Wide Web. Hypertext Markup Language (HTML) is a language used to create static Web pages. The protocol transfers data in the form of plain text, hypertext, audio, video and so on. It is called HTTP because it is used in an environment where there are rapid jumps from one document to another HTTP functions like a combination of FTP and SMTP - It is similar to FTP because it transfers files and uses the services of - Dr. L. Christofi TCP (via port 80). There is no separate control connection – only data are transferred between the client and the server HTTP is also similar to SMTP because the data transferred between the client and the server are similar to SMTP messages 73 WWW (1) • The HTTP is the main protocol used to access data on the World Wide Web (WWW). • The World Wide Web is a repository of information spread all over the world and linked together. • Hypertext and hypermedia are documents linked to one another through the con-cept of pointers. • Browsers interpret and display a Web document. • A browser consists of a controller, client programs, and interpreters. • A Web document can be classified as static, dynamic, or active. • A static document is one in which the contents are fixed and stored in a server. The client can make no changes in the server document. • Any browser can read formatting instructions (tags) embedded in an HTML document. Dr. L. Christofi 74 WWW (2) • A dynamic Web document is created by a server only at a browser request. • The Common Gateway Interface (CGI) is a standard for creating and handling dynamic Web documents. A CGI program with its embedded CGI interface tags can be written in a language such as C, C++, shell script, or Perl. • The server sends the output of the CGI program to the browser. • The output of a CGI program can be text, graphics, binary data, status codes, instructions, or an address of a file. • An active document is a copy of a program retrieved by the client and run at the client site. • Java is a combination of a high-level programming language, a run-time environment, and a class library that allows a programmer to write an active document and a browser to run it. • Java is used to created applets (small application programs). • Java is an object-oriented typed language with a rich library of classes. Dr. L. Christofi 75 SNMP • The Simple Network Management Protocol (SNMP) is an application layer protocol that facilitates the exchange of management information between network devices. • An SNMP managed network consists of the following: — Network management system (NMS) — Managed device — Agents Dr. L. Christofi 76 Telnet • Telnet client software provides the ability to log in to a remote Internet host that is running a Telnet server application and then to execute commands from the command line. Dr. L. Christofi 77 Exercise 3 Design a private LAN, with the following topology, that would allow the exchange of data: Your subnet is 192.168.200.64. You should use appropriate subnet mask and assign appropriate IP addresses to all network elements (routers & hosts) having in mind possible future expansion of your network for 5 additional hosts. You have been told not to waste unnecessary IP addresses. Dr. L. Christofi 78 Exercise 3 (answer) Subnet is 192.168.200.64. Present number of hosts is 5, Number of routers is 2 and for future expansion 5 additional hosts, makes a total of 12 addresses. Hence use 255.255.255.240 Subnet Mask. Broadcast IP address for this network is reserved to 192.168.200.79 therefore available IP addresses are from 192.168.200.65 to 192.168.200.78 Dr. L. Christofi 79 References • W. Stalling, Local and Metropolitan Area Networks, 6th edition, Prentice Hall, 2000 • B.A. Forouzan, Data Communications and Networking, 3rd edition, McGraw-Hill, 2004 • W. Stallings, Data and Computer Communications, 7th edition, Prentice Hall, 2004 • F. Halsall, Data Communications, Computer Networks and Open Systems, 4th edition, Addison Wesley, 1995 Dr. L. Christofi 80