Dr. Tim Lin ECE Department Cal Poly Pomona For CS499 Team ...

45
2/15/10 Dr. Tim Lin ECE Department Cal Poly Pomona For CS499 Team Teaching Class Winter 2010 EXIT >

Transcript of Dr. Tim Lin ECE Department Cal Poly Pomona For CS499 Team ...

2/15/10

Dr. Tim Lin ECE Department Cal Poly Pomona For CS499 Team Teaching Class Winter 2010

EXIT >

user@domain

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)

2/15/10

Application

Presentation

Session

Transport

Network

Link

Physical

EXIT MAIN MENU > <

Figure 2.4 OSI layers

Figure 2.5 An exchange using the OSI model

2/15/10

EXIT OSI > <

•  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

2/15/10

EXIT OSI > <

•  Purposes: Provides user interface

•  Examples: Telnet, FTP, HTTP, SNMP, SMTP

2/15/10

EXIT OSI > <

•  Purposes: Presents data to the application layer.

•  Functions: data compression

•  Examples: JPEG, TIFF

2/15/10

EXIT OSI > <

•  Purposes: Provides continuous session that survives after link failure and recovery

•  Examples: RPC, SQL

2/15/10

EXIT OSI > <

•  Purposes: Provides end to end data transport services.

•  Examples: TCP, UDP

2/15/10

EXIT OSI > <

•  Purposes: Responsible for routing through an internetworking and for network addressing.

•  Procotolcs: IP, IPX, ARP, ICMP, IGMP •  Devices: Router

2/15/10

EXIT OSI > <

•  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

2/15/10

EXIT OSI > <

•  Purposes: Handles transfer of bits

•  Protocols: IEEE 802, IEEE802.2, ISDN

•  Examples: Repeater, multiplexer

2/15/10

EXIT 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

2/15/10

•  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.

2/15/10

•  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 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

Setting Own IP address

Static IP

Dynamic or DHCP

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.

Finding the class of address (From Forouzan Figure5-6, 4th edition)

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.8 Netid and hostid (McGrawHill, Fourouzan, 4th edition, TCP / IP Protocl Sutie_

Figure 5.10 Blocks in Class B

An address in a block is given as 180.8.17.9. 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 18.8.0.0/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 18.8.255.255.

Figure 5.17 Solution to Example 5.14

Figure 5.19 Sample Internet

Figure 5.24 Example 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

TCP/IP Protocol Suite 34

Which of the following can be the beginning address of a block that contains 16 addresses?

a. 205.16.37.32 b.190.16.42.44 c. 17.17.33.80 d.123.45.24.52

Example 1

Solution Only two are eligible (a and c). The address 205.16.37.32 is eligible because 32 is divisible by 16. The address 17.17.33.80 is eligible because 80 is divisible by 16.

TCP/IP Protocol Suite 35

TCP/IP Protocol Suite 36

Find the block if one of the addresses is 190.87.140.202/29.

Example 10

See Next Slide

Solution We 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:

TCP/IP Protocol Suite 37

202 ➡ 128 + 64 + 0 + 0 + 8 + 0 + 2 + 0

The leftmost 5 numbers are ➡ 128 + 64 + 0 + 0 + 8

The first address is 190.87.140.200/29

Example 10 (Continued)

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 190.87.140.207/29. In other words, the first address is 190.87.140.200/29, the last address is 190.87.140.207/20. There are only 8 addresses in this block.

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.

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

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

Figure 26.5 Address space allocation

Figure 26.9 Compatible address

Figure 26.10 Mapped address