Você está na página 1de 22

hp education services education.hp.

com

LAN Concepts

Version C.01 H3065S Module 1 Slides

What Is a Network?
A Network is a series of devices interconnected by communication pathways. Local Area Networks (LANs) span relatively small geographic areas. Wide Area Networks (WANs) span relatively large geographic areas.

WAN

Chicago Office LAN

Tokyo Office LAN

Boston Office LAN

H3065S C.01

2001 Hewlett-Packard Company

The OSI Model in a Nutshell


7 6 5 Application Presentation Session How is data created and used? How is the data represented to the application? Is the data in EBCDIC or ASCII format? How does an application initiate a connection? How does an application actually transmit/receive data? How does an application know data has been received? Should the receiver acknowledge receipt of a packet? How should the acknowledgement be handled? Which process should receive the data? How is data routed between networks? How do I know when its my turn to transmit? How do I know which data is for me? How are collisions handled?

Transport

3 2

Network Data link

Physical

What kinds of cabling are supported? What kinds of connectors are supported? Whats the longest supported cable segment?

H3065S C.01

2001 Hewlett-Packard Company

Media Access Control (MAC) Addresses


Every LAN card has a unique 48-bit MAC address. Every frame of data contains a source and destination MAC.

Hosts accept frames destined for their MAC address.


Hosts ignore frames destined for other MAC addresses.

0x0060B07ef226
Following number is in hex ... These six hex digits identify the card manufacturer
4

Which frames are for me?

These six hex digits uniquely identify this card


2001 Hewlett-Packard Company

H3065S C.01

Internet Protocol (IP) Addresses


Every host on an IP network has a unique, 32-bit IP address. IP addresses make it possible to logically group nodes into IP networks.

Network bits within the IP determine which network the host is on.
Host bits within the IP distinguish each host from all other hosts on the network. Hosts with identical network bits are said to be on the same IP network.

128.1.1.1
Which network is the host on?

128.1.1.1

128.1.1.2

What is the host's address on that network?


5

128.1 Network

H3065S C.01

2001 Hewlett-Packard Company

IP Network Classes
The IP address network/host bit boundary varies from network to network. Networks with more host bits may have more hosts. Networks with fewer host bits may have fewer hosts.

/8 Network

8 Network Bits 8 Network Bits 8 Network Bits

8 Host Bits 8 Network Bits 8 Network Bits

8 Host Bits 8 Host Bits 8 Network Bits

8 Host Bits 8 Host Bits

/16 Network

/24 Network

8 Host Bits

H3065S C.01

2001 Hewlett-Packard Company

The IP Netmask
100000000 00000001 00000001 00000001

IP Address: 128.1.1.1/16
Netmask: 255.255.0.0 or 0x ff ff 00 00

111111111

11111111

00000000

00000000

Netmask 1's identify network bits

Netmask 0's identify host bits

Q: How many bits in my IP are network bits? A: The netmask has the answer!

H3065S C.01

2001 Hewlett-Packard Company

The IP Network Address


Every host must know which network it is connected to. Formulate the network address by setting all IP host bits to "0". 128.1.1.1/16 128.1.1.2/16 128.1.1.3/16 192.1.1.1/24 192.1.1.2/24 192.1.1.3/24 Network Address: 128.1.0.0/16 100000000 00000001 00000000 00000000

Network Address: 192.1.1.0/24 110000000 00000001 00000001 00000000

Q: Which network am I on?

H3065S C.01

2001 Hewlett-Packard Company

The IP Broadcast Address

128.1.1.1

128.1.1.2

128.1.1.3

Packets sent to the network broadcast address are received by ALL hosts on the network. Formulate the broadcast address by setting all host bits to "1".

# ping 128.1.255.255
H3065S C.01 9 2001 Hewlett-Packard Company

The IP Loopback Address


The loopback address, 127.0.0.1, is a special address that always references your local host.

128.1.1.1

128.1.1.2

128.1.1.3

# ping 127.0.0.1

H3065S C.01

10

2001 Hewlett-Packard Company

Obtaining an IP Address

Private Intranet
Firewall

Public Internet

Obtaining an IP address on a Private Intranet allows limited access to the Internet via a network Firewall.

Obtaining an IP address on the Public Internet allows direct connectivity to millions of hosts worldwide.

H3065S C.01

11

2001 Hewlett-Packard Company

IP Address Examples
IP Address 192.66.123.4/24 Netmask Network Broadcast

148.10.12.14/16
9.12.36.1/8 163.128.19.9/16

123.45.65.23/8
199.66.55.4/24

H3065S C.01

12

2001 Hewlett-Packard Company

Host Names
/etc/hosts I can reference nodes by host name and let HP-UX automatically determine the IP addresses for me!

128.1.1.1 128.1.1.2 128.1.1.3 128.1.1.4

sanfran oakland la sandiego

Telnet request To: 128.1.1.2 # telnet oakland 128.1.1.2 (oakland)

H3065S C.01

13

2001 Hewlett-Packard Company

Converting IP Addresses to MAC Addresses


Source MAC: Destination MAC: 080009-000001 080009-000002 Outbound Frame 128.1.1.1 (sanfran) 080009-000001
/etc/hosts 128.1.1.1 128.1.1.2 128.1.1.3 sanfran oakland la

128.1.1.2 (oakland) 080009-000002


ARP cache (memory resident)
128.1.1.1 128.1.1.2 128.1.1.3 080009-000001 080009-000002 080009-000003

Example: System sanfran pings system oakland 1. Resolve hostname oakland to an IP address. 2. Lookup the MAC address in the ARP cache corresponding to oakland's IP address. 3. Send the packet to oakland's MAC address.

H3065S C.01

14

2001 Hewlett-Packard Company

Populating the ARP Cache


6
ARP cache

Broadcast Packet

4 2
128.1.1.1 128.1.1.2 128.1.1.3 128.1.1.4 128.1.1.4 080009-000001 080009-000002 080009-000003 incomplete! 080009-23EF45

128.1.1.2 (oakland)

128.1.1.3 (la)

128.1.1.4 (sandiego)

128.1.1.1 (sanfran) Example: sanfran pings sandiego 1. 2. 3. 4. 5. 6.

$ ping sandiego

sanfran pings sandiego. sanfran resolves sandiego's IP address via /etc/hosts. Search for sandiego's IP in the arp cache the IP address is not found in ARP cache. Send ARP broadcast on the local network to find the MAC address for 128.1.1.4. System with the specified IP address responds with a packet containing its MAC. The MAC address and corresponding IP address are added to sanfran's ARP cache. The frame specifically addressed to sandiego's MAC address is sent.
15

H3065S C.01

2001 Hewlett-Packard Company

Putting It All Together


Is the destination a hostname or an IP address?
hostname

IP address

Resolve hostname to corresponding IP address.

No

Is the destination IP address found in ARP cache?

Yes

Look for the destination IP address in routing table.

Send a broadcast requesting the MAC for the destination IP. Destination machine responds with its MAC address.
Yes, on local network

No

Is the destination on the local network?

Use the MAC address found in ARP cache as the destination MAC.

Record the found MAC address in the ARP cache for later reference. Send the packet out on the wire with the source and destination MAC and IP addresses.

Send packet to router to be forwarded to destination host.

H3065S C.01

16

2001 Hewlett-Packard Company

Managing Packet Flow with TCP


Retransmit

4
3 1 2 2
Data Packets

3
1

Send Packet

Acknowledgements

1 6
Reassemble

2
Segment Data

1 2 3

Open Close

sanfran 128.1.1.1

oakland 128.1.1.2

Sending a packet with TCP: 1. Open connection to remote node. 2. Segment data into datagram packets. 3. Send datagrams to destination node.

4. If there is no acknowledgement, retransmit!


5. Close connection after all datagrams are received. 6. Receiver node reassembles datagrams into proper order.
H3065S C.01 17 2001 Hewlett-Packard Company

Managing Packet Flow with UDP


2 1

2
1

1
128.1.1.1 (sanfran)

3
128.1.1.2 (oakland)

Sending a packet with UDP: 1. Packets cannot be segmented or streamed; a packet is always sent as a single message. 2. No connection is opened with the node; the packet is simply sent to the node. 3. No acknowledgement is sent back to the original sender. Since the original sender never knows if packet is received, sender never retransmits. The receiver doesnt know if it received all of the intended packets. With UDP, the application is responsible for ensuring data transmission is complete.

H3065S C.01

18

2001 Hewlett-Packard Company

Sending Data to Applications via Ports


To: port 23 To: port 21 To: port 513

Network Subsystem telnetd


port 23

ftpd
port 21

rlogind
port 513

128.1.1.2 (oakland)
$ telnet sanfran

128.1.1.3 (la)
$ ftp sanfran

128.1.1.4 (sandiego)
$ rlogin sanfran

128.1.1.1 (sanfran)

Problem: Who gets the data?


Thousands of packets arrive every minute on the LAN interface card. How does the network subsystem know to which application to deliver the network packets?

Solution: Assign each application a unique port number.


When each packet is sent, a port number will be included in the packet. The port numbers identify which network application is to receive the packet.
H3065S C.01 19 2001 Hewlett-Packard Company

Managing Ports with Sockets


To: port 23 To: port 23 To: port 23

Network Subsystem telnetd telnetd telnetd ftpd

128.1.1.2 (oakland) $ telnet sanfran $ telnet sanfran

128.1.1.3 (la) $ telnet sanfran $ ftp sanfran

128.1.1.1 (sanfran) Problem: Which network application gets the data when multiple instances are present? Multiple clients can be executing the same network application. Multiple instances of the network application can be running on the same client. Solution: Create a unique socket for each process which runs a network application. A socket is a port number combined with a nodes IP address. A socket connection is the coupling of a client socket address with a server socket address.
H3065S C.01 20 2001 Hewlett-Packard Company

More on Socket Connections


To: port 23 To: port 23

Network Subsystem telnetd 128.1.1.1.23 telnetd 128.1.1.1.23

telnet 128.1.1.2.50001

telnet 128.1.1.2.50002

128.1.1.2 (oakland)

128.1.1.1 (sanfran)

128.1.1.2 . 50001
128.1.1.2 . 50002 Socket

$ telnet sanfran $ telnet sanfran

128.1.1.1 . 23

128.1.1.1 . 23
Socket

Communications between two processes over the network are uniquely defined by their socket connection.
21

H3065S C.01

2001 Hewlett-Packard Company

Revisiting the OSI Model


7 6 5 Application Presentation Session Creates/receives the data. Determines the format in which to represent the data. Possible choices are EBCDIC or ASCII format. Establishes a unique communication path between client/server. Sockets are used to communicate between two systems. A socket is an IP address plus a port number.

Transport

TCP requires that a socket connection be established; UDP does not. TCP requires packets be acknowledged; UDP does not. TCP is streams-based; UDP is message-based.
IP addresses define a systems network and host number. MAC addresses uniquely identify a LAN card. Ultimately, packets are sent from one MAC address to another. ARP caches map IP addresses to MAC addresses. The type of media used to connect the machines together. The type of cabling used for the network.

3 2

Network Data link

Physical

H3065S C.01

22

2001 Hewlett-Packard Company

Você também pode gostar