Networking Fundamentals Dr. Tim Lin ECE Department Cal Poly Pomona For CS499 Team Teaching Class Winter 2010 Add CorporateLogoHere > EXIT
Reference Behrouz A. Fourouzan: TCP / IP Protocol Suite 4th edition, McGraw Hill and TCP / IP Protocol Suite 3rd edition, McGraw Hill Also, the corresponding PowerPoint Files
Agenda What is Computer Network ISO / OSI model Internet Organizations IP Addresses v4 Classful Classless V6 IP Protocol Header ICMP Protocol • UDP Protocol • TCP Protocol • Header • Flow Control • Error Control • Congestion Control • FTP Protocol • HTTP Protocol • SMTP Protocol • Network Commands • Technology (LAN)
OSI 7 Layers Application Presentation Session Transport Network Link Physical < > MAIN MENU EXIT
Why Multi-Layers? • Phone Call (synchronous, like TCP) • Physical: phone line, wireless • Layer 2: The two parties speak the same language • Layer 3: The two parties are related (not unsolicited calls from telemarketing) • Higher layers: The two parties have common topics, interests, and mood of talking (ever received calls from your friends at the wrong moment or with some topics you don’t want to talk?). • US Mail (Asynchronous, like UDP) • Physical = ? • Link Layer = ? • Network Layer (use postal address) • E-mail < > OSI EXIT
Application • Purposes: Provides user interface • Examples: Telnet, FTP, HTTP, SNMP, SMTP < > OSI EXIT
Presentation • Purposes: Presents data to the application layer. • Functions: data compression • Examples: JPEG, TIFF < > OSI EXIT
Session • Purposes: Provides continuous session that survives after link failure and recovery • Examples: RPC, SQL < > OSI EXIT
Transport • Purposes: Provides end to end data transport services. • Examples: TCP, UDP < > OSI EXIT
Network • Purposes: Responsible for routing through an internetworking and for network addressing. • Procotolcs: IP, IPX, ARP, ICMP, IGMP • Devices: Router < > OSI EXIT
Data Link • Purposes: Getting data from one computer to another computer. • There are two sublevels • Logical Link control • Medium Access control (MAC) • Protocols: IEEE802.3 CSMA/CD, 802.4 Token Bus, 802.5 Token Ring • Devices: Bridge, NIC < > OSI EXIT
Physical • Purposes: Handles transfer of bits • Protocols: IEEE 802, IEEE802.2, ISDN • Examples: Repeater, multiplexer < > OSI EXIT
Web Links for OSI • OSI Model 1: • http://www.serverwatch.com/tutorials/article.php/1474881 • OSI Model 2: • http://www.geocities.com/SiliconValley/Monitor/3131/ne/osimodel.html • OSI Model 3: • http://www.wikipedia.org/wiki/OSI_model < > OSI EXIT
TCP / IP Protocol Stack • There are hundreds of TCP IP protocols, among them TCP, IP, UDP, FTP, ICMP, are a few (in)famous ones. • See the poster PDF on the network protocols from Agilent technology.
Special Networks • WAN (Wide Area Network) • MAN (Metropolitan Area Network) • LAN (Local Area Network) • 802.3 Ethernet • 802.11 Wireless • 802.16 WiMax • PAN (Personal Area Network) • Bluetooth (802.15) • CAN (Controller Area Network): HC12, PIC • SAN • Storage Area Network • Sensor Area Network
Internet Administration (some of them) • Internet Engineering Task Force (IETF): • Protocol standards in RFC • http://www.ietf.org/ • Internet Assigned Number Authority (IANA) • : protocol assignments and domain names • http://www.iana.org/ • Institute of Electrical and Electronic Engineers (IEEE) • Hardware address of your NIC card • http://www.ieee.org
Getting IP address of your computer (DOS) Command: DHCP IP address DNS Physical Address
Setting Own IP address Dynamic or DHCP Static IP Private IP
IPv4 addresses • Uses 4 bytes as in previous chars 17 and 20 • The bytes are presented in decimals in 0-255 range • Used as classful (A, B, C, D and E) and classless (subnetting or CIDR) • Every computer with an NIC (Network Interface Card) has an IP address. Some computers may have multple IP addresses.
Find IP address of web site What are the classes of these 4 sites: CPP, Yahoo, Google, IEEE?
Classful IP Addresses • Use Class A (first byte) • Class B (first 2 bytes) • Class C (first 3 bytes) • And Class D and E
Figure 5.8Netid and hostid (McGrawHill, Fourouzan, 4th edition, TCP / IP Protocl Sutie_
Example 5.14 An address in a block is given as 22.214.171.124. Find the number of addresses in the block, the first address, and the last address. Solution Figure 5.17 shows a possible configuration of the network that uses this block. 1. The number of addresses in this block is N = 232−n = 65,536. 2. To find the first address, we keep the leftmost 16 bits and set the rightmost 16 bits all to 0s. The first address is 126.96.36.199/16, in which 16 is the value of n. 3. To find the last address, we keep the leftmost 16 bits and set the rightmost 16 bits all to 1s. The last address is 188.8.131.52.
Figure 5.24Example 5.19 Subnetting example into 4 subnets
CIDR or Classless • Variable length blocks • Format • x.y.z.t/n with 1 <= n <= 32 • Extension of Classful addressing • Class A: n = 8 • Class B: n = 16 • Class C: n = 24
Example 1 Which of the following can be the beginning address of a block that contains 16 addresses? a. 184.108.40.206 b.220.127.116.11c. 18.104.22.168 d.22.214.171.124 SolutionOnly two are eligible (a and c). The address 126.96.36.199 is eligible because 32 is divisible by 16. The address 188.8.131.52 is eligible because 80 is divisible by 16. 34 TCP/IP Protocol Suite
Table 5.1 Prefix lengths 35 TCP/IP Protocol Suite
Example 10 Find the block if one of the addresses is 184.108.40.206/29. SolutionWe follow the procedure in the previous examples to find the first address, the number of addresses, and the last address. To find the first address, we notice that the mask (/29) has five 1s in the last byte. So we write the last byte as powers of 2 and retain only the leftmost five as shown below: See Next Slide 36 TCP/IP Protocol Suite
Example 10 (Continued) 202 ➡ 128 + 64 + 0 + 0 + 8 + 0 + 2 + 0 The leftmost 5 numbers are ➡ 128 + 64 + 0 + 0 + 8 The first address is 220.127.116.11/29 The number of addresses is 232−29 or 8. To find the last address, we use the complement of the mask. The mask has twenty-nine 1s; the complement has three 1s. The complement is 0.0.0.7. If we add this to the first address, we get 18.104.22.168/29. In other words, the first address is 22.214.171.124/29, the last address is 126.96.36.199/20. There are only 8 addresses in this block. 37 TCP/IP Protocol Suite
Special IP addresses • Loopback (localhost): 127.0.0.08 • Do you know usage of localhost in any applications? • Running Client / server in one computer (why?) • Run PHP / JSP / J2EE Server etc. in local computer. • Private IP addresses • 10.0.0.0./8 (10.0.0, 1 block) • 172.16.0.0/12 (172.16 to 172.1, 16 blocks) • 192.168.0.0/16 (192.168.0 to 192.168.255, 256 blocks)
IPv6 • IP addresses of (near) future since IPv4 of 232 or 4 billion addresses (< 6 billion people). • Use 16 bytes instead of 4 bytes • Consider ISBN-10 and ISB-13 are used concurrently now, someday, IPv6 may exist concurrently with IPv4 and finally IPv4 may phase out. • Transition has to be handled so that IPv4 address can be represented as part of IPv6 address.
Example 26.1 Show the unabbreviated colon hex notation for the following IPv6 addresses: a. An address with 64 0s followed by 64 1s. b. An address with 128 0s. c. An address with 128 1s. d. An address with 128 alternative 1s and 0s. Solution a. 0000:0000:0000:0000:FFFF:FFFF:FFFF:FFFF b. 0000:0000:0000:0000:0000:0000:0000:0000 c. FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF d. AAAA:AAAA:AAAA:AAAA:AAAA:AAAA:AAAA:AAAA
Example 26.2 The following shows the zero contraction version of addresses in Example 26.1 (part c and d cannot be abbreviated) a. :: FFFF:FFFF:FFFF:FFFF b. :: c. FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF d. AAAA:AAAA:AAAA:AAAA:AAAA:AAAA:AAAA:AAAA