43
Network Implementation Laboratory Electrical and Computer Engineering Department Ben Allen Instructor August 28, 2006 Lesson 1 NETWORKING BASICS

Network Implementation Laboratory Electrical and Computer

Embed Size (px)

Citation preview

Page 1: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Electrical and Computer Engineering Department

Ben AllenInstructor

August 28, 2006Lesson 1

NETWORKING BASICS

Page 2: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Overview

• What is a communications protocol?• The OSI Model• The IP Stack• IP Addressing

Page 3: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

What is a Communications Protocol?

• From Wikipedia (http://en.wikipedia.org/wiki/Communications_protocol, August 27, 2006, 1140): “[A] communications protocol is the set of standard rules for data representation, signaling, authentication, and error detection required to send information over a communications channel.”

Page 4: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

The OSI Model

• The International Standards Organization (ISO) Open Systems Interconnect (OSI) Model is a seven layer conceptual model that is a frame of reference for defining the protocol interaction between network entities.

Page 5: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Layers of the OSI Model (From the bottom up)

1. Physical2. Data Link3. Network 4. Transport 5. Session 6. Presentation 7. Application

Page 6: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Layers of the OSI Model, Physical Layer

• Specifies physical characteristics of the communications channel

• Medium – Electrical Impulses over Copper

Wire– Electromagnetic waves in space– Electromagnetic waves through a

medium

Page 7: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Layers of the OSI Model,

Physical Layer (Cont.)Physical Connectors

• RJ-45• RJ-48• BNC

– Line coding• BRZ-AMI• B8ZS• Manchester• Differential Manchester

Page 8: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Layers of the OSI Model,

Data Link Layer• Specifies parameters for the

transmission of protocol data units between stations on the same network segment – Access to the communications channel– Station Identification and addressing – Framing or encapsulation of protocol

data units

Page 9: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Layers of the OSI Model,

Data Link Layer (Cont.)– Detection and correction of physical

errors– Examples of Data Link protocols

• Ethernet• 802.11a,b,g WiFi• Token Ring• ATM

Page 10: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Layers of the OSI Model, Network Layer

• Specifies parameters for the transmission of protocol data units between stations across an inter-network, independent of the underlying physical and logical network segments

• Global identification and addressing• Provides a method of routing packets across a

global topology• Framing or Encapsulation of protocol data

units• Examples of network layer protocols are IP,

IPX, OSI

Page 11: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Layers of the OSI Model,

The rest…• Transport Layer provides transportation of PDUs

between service ports on end stations and is concerned with reliable delivery, segmentation and re-assembly in proper order and error detection and correction

• Session Layer governs the orderly creation and termination of communication sessions between processes running at service ports on end stations

• Presentation Layer governs data presentation and translation between processes and also handles data encryption

• Application Layer governs the transfer of messages between applications: http, smtp, snmp, pop, imap

Page 12: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

The IP stack

• While the OSI model presents a conceptual frame of reference for building and analyzing network protocols, it is not really implemented in practice. In today’s global internet, the Internet Protocol (IP) stack is used. The IP stack is a 4 layer stack with rough analogues to the OSI model.

Page 13: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

The IP stack (Cont.)

Stack Layers from the Bottom up:• Link

– Corresponds roughly to the combined Physical and Data Link layers of the OSI model

• Network– Corresponds directly to the Network layer of the OSI

model

• Transport– Corresponds directly to the Transport layer of the OSI

model

• Application– Corresponds roughly to the Session, Presentation and

Application layers of the OSI model

Page 14: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Our Focus…

For this class, we will be concerned primarily with the first 2 IP stack layers or first 3 OSI Model layers. We will be building IP communications networks over a variety of link topologies.

Page 15: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addressing

• What is an IP address?

Page 16: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addressing

• What is an IP address?– A generally globally unique address that

identifies a station – or more specifically a network interface – on an IP inter-network

Page 17: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addressing

• What is an IP address?– A generally globally unique address that

identifies a station – or more specifically a network interface – on an IP inter-network

• What is the format of an IP address?

Page 18: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addressing

• What is an IP address?– A generally globally unique address that

identifies a station – or more specifically a network interface – on an IP inter-network

• What is the format of an IP address?– It is a 4 octet binary number, usually

represented – for human consumption – in dotted decimal notation

Page 19: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addressing (Cont.)

• What are the two parts of an IP address?

Page 20: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addressing (Cont.)

• What are the two parts of an IP address?– An IP address is composed of a network

portion and a host portion determined by the network mask (also called the subnet mask)

Page 21: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Network Mask

• A network mask is just a bit mask: it’s a string of contiguous 1s and 0s. It is combined with an IP address in and AND operation to yield an IP network number.

Page 22: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Network Mask Example

• Address– 192.168.32.17

• Mask– 255.255.255.0

• In Binary:– 1100 0000.1000 1000.0010 0000.0001

0001– 1111 1111.1111 1111.1111 1111.0000

0000

Page 23: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Network Mask Example (Cont.)

1100 0000.1000 1000.0010 0000.0001 00011111 1111.1111 1111.1111 1111.0000 0000• Perform AND operation to get network:

– 1100 0000.1000 1000.0010 0000.0000 0000– 192.168.32.0

• The host number is the inverse:– 0000 0000.0000 0000.0000 0000.0001 0001 – 0.0.0.17 or 17

Page 24: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Address Classes and Natural Network Masks

• IP addresses were originally divided into 5 classes designated by the letters A through E. The first three each have a standard, natural network mask suited for addressing a particular sized network. These are used to build the global IP inter-network topology (the Internet). The last two classes have special applications.

Page 25: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addresses and Natural Network Masks

(cont’d) • Class A addresses are identified by a

leading 0 in the first octet:• 0000 0000 through 0111 1111, or • 0 – 127• The natural network mask for a class A

address is 255.0.0.0 – an 8 bit mask• Class A addresses range from 0.0.0.0

to 127.255.255.255

Page 26: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addresses and Natural Network Masks

(cont’d)• Class B addresses are identified by a

leading 10 in the first octet:• 1000 0000 through 1011 1111, or• 128 – 191• The natural network mask for a class B

address is 255.255.0.0 – a 16 bit mask• Class B addresses range from

128.0.0.0 to 191.255.255.255

Page 27: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addresses and Natural Network Masks

(cont’d)• Class C addresses are identified by a

leading 110 in the first octet:• 1100 0000 through 1101 1111, or• 192 – 223• The natural network mask for a class C

address is 255.255.255.0 – a 24 bit mask

• Class B addresses range from 192.0.0.0 to 223.255.255.255

Page 28: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addresses and Natural Network Masks

(cont’d)• Class D addresses are identified by a

leading 1110 in the first octet:• 1110 0000 through 1110 1111, or• 224 – 239• Class D addresses are used for

Internet Multicast – sending streams of data to a group of endpoints

• Class D addresses range from 224.0.0.0 to 239.255.255.255

Page 29: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

IP Addresses and Natural Network Masks

(cont’d)• Class E addresses are identified by a

leading 1111 in the first octet:• 1111 0000 through 1111 1111, or • 240 – 255• Class E addresses are considered

Experimental – to be used in research projects and the like. As a matter of policy, they should never be advertised to the public internet.

• Class E addresses range from 240.0.0.0 to 255.255.255.255

Page 30: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Classless Interdomain Routing (CIDR)

• Even to a casual observer, it becomes quickly apparent that the classful addressing structure presents some serious allocation problems.

• What few lucky groups in the world should be allocated addresses from the class A range?

• How do we handle small organizations that need but a handful of addresses?

• To fix this, CIDR was developed. This allows us to assign networks of any legal size from any of the class A-C ranges.

Page 31: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Classless Interdomain Routing (CIDR) (Cont.)

• CIDR addresses and networks are expressed in dotted decimal notation with a bitmask length appended:

• 192.168.32.17/24 is an example of CIDR notation for a host address. This host is a member of the network 192.168.32.0/24

Page 32: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Some Special IP Address Reservations and

AllocationsGlobal Reservations • The range 0.0.0.0/8 is reserved for

no specific application, but it maintains consistency in broadcast rules discussed later

• The range 127.0.0.0/8 is reserved for designating loopback addresses (usually only 127.0.0.1 is used)

Page 33: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Some Special IP Address Reservations and

Allocations• The range 255.0.0.0/8 is reserved for

global broadcast (usually only 255.255.255.255 is used)

• RFC 1918 specifies three address ranges to be used for private addressing with a routing scope limited to an autonomous system or administrative domain. These address ranges are:– 10.0.0.0/8– 172.16.0.0/12– 192.168.0.0/16

Page 34: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Some Special IP Address Reservations and

AllocationsLocal Reservations• Every IP network reserves 2

addresses that CANNOT be assigned to hosts:

• The zero address is reserved as a network identifier

• The all-ones address is reserved for broadcast

Page 35: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Some Special IP Address Reservations and

Allocations• Every contiguous collection of IP

networks under the same administrative control (an ip address allocation to an autonomous system) must reserve the first (zero) and last (ones) subnet.– This is to facilitate broadcast within an

autonomous system– This requirement has been deprecated as

very few organizations allow directed broadcast in practice

Page 36: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Testing IP Connectivity With ping and

traceroute/tracertESSENTIAL IP troubleshooting

commands• ping• traceroute or tracert

Page 37: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Testing IP connectivity with ping and

traceroute/tracert• Ping sends ICMP echo requests to a target and

expects ICMP echo replies in a set period of time. The utility will report the return state of the packet, the round-trip-time (how much time between the origin of the request and the receipt of the reply) and the Time To Live counter value. This is useful in determining general reachability of an end host.

• Traceroute or – in windows – tracert will send udp or icmp packets to a destination with incrementing Time To Live values in order to determine the route to a remote destination. This is useful in predicting where network faults are occurring.

Page 38: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Testing IP connectivity with ping and

traceroute/tracert• A practical method for using these tools in

troubleshooting an apparent network problem:• ping your loopback address – if successful, this

will tell you that you have a functioning IP stack• ping your IP address – if successful, this tells you

that your address is properly configured and that the interface reports a positive link status

• ping another host on your local network segment – if successful, this means that your local network segment is up and passing traffic

• ping your router – if successful, this tells you that the router is up and attached to your network

Page 39: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Testing IP connectivity with ping and

traceroute/tracert• ping a remote host other than the target – if

successful, this tells you that the router is routing (some) traffic

• ping the remote target host – if successful, this tells you that the remote host is reachable across the inter-network (if there was a problem, it is not likely a network problem)

• Be careful about assuming too much about failures in this process. While a positive response diagnoses a symptom (X is working), a negative response diagnoses nothing off the bat: it only tells you where to start looking.

Page 40: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Testing IP connectivity with ping and

traceroute/tracert• In this process, traceroute is useful for

failures at step 5 and 6. After a negative response, traceroute can tell you how far along the route you can get. While the problem may be with the last responding router, many times it is actually the next router in the chain (the first router that could not respond to you). Again, this tells you where to start looking, it doesn’t give you a perfect diagnosis.

Page 41: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Testing IP connectivity with ping and

traceroute/tracert• Security devices further obscure these

problems – many times firewalls and packet filters will drop ICMP packets (or traceroute UDP packets) as a preventative measure against worms and hackers scanning their networks.

• As an example, www.microsoft.com will not reply to ICMP echo requests. If your problem is name resolution and you try the above tests, it will look very much like a routing problem in the remote network. Make sure you try some sanity checks before jumping to conclusions.

Page 42: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

Some Good Resources for additional information:

• Protocol Stack from Wikipedia:• http://en.wikipedia.org/wiki/Protocol_stack, • August 27, 2006, 1145

• OSI Model from Wikipedia:• http://en.wikipedia.org/wiki/OSI_model, • August 27, 2006, 1145

• A humorous example of the functioning of a protocol stack: http://www.lewistech.com/rlewis/Resources/james.aspx, August 27, 2006, 1200

• I take issue with one portion of this: On the last page, they refer to “switching” as a layer 3 function. This is more appropriately a layer 2 (data link) function. This article is not to be used as an authoritative source for study, rather as a helpful illustration of the general workings of a protocol stack.

Page 43: Network Implementation Laboratory Electrical and Computer

Network Implementation Laboratory

More Good Resources for additional information:

• Internet Protocol Suite from Wikipedia:

• http://en.wikipedia.org/wiki/Internet_protocol_suite, August 27, 2006, 1640

• Internet Protocol Tutorial: http://compnetworking.about.com/od/workingwithipaddresses/l/aa042400b.htm, August 27, 2006, 1630