Networking Basics & OSI Reference Model. NIC, OSI Reference Model

Networking Basics & OSI Reference Model NIC, OSI Reference Model 1 Networking: An Overview A network is a group of interconnected systems which sh...
Author: Leon Sanders
2 downloads 0 Views 3MB Size
Networking Basics & OSI Reference Model

NIC, OSI Reference Model

1

Networking: An Overview A network is a group of interconnected systems which share services and interact with each other by means of a shared communication link. These systems can be located anywhere. Network is often classified according to its geographical size. NIC, OSI Reference Model

2

Networking

NIC, OSI Reference Model

3

Benefits of networking Goal of having networking environment is to provide services and to reduce the equipment costs. The primary reasons for networking PC's are as follows: ØSharing printers and other devices ØProviding Distributed Computing. ØSharing Files ØCentralised administration of resources ØSecurity of Resources. ØPersonal communications (like e-mail, chat, audio/video conferencing) NIC, OSI Reference Model ØWorld Wide Web ... and many other uses

4

Networking Basics

NIC, OSI Reference Model

5

Networking Basics n

Network consist many components: – Hardware » Transmission Facilities » Access Devices » Devices that repeat transmitted signals

– Software » Protocol that define and regulate the way two or more device communicate. » Drivers, that guide the functionality of NIC » Communication Software. NIC, OSI Reference Model

6

Networking Basics: Hardware n

Transmission Facilities – Are the media used to transport network’s signals to their destination. » Coaxial Cable, Twisted Pair, Fiber- Optic

n

Access Devices – Is known as Network Interface Card (NIC), and is responsible for » Properly formatting data so that it can be accepted in the network » Placing data on the network » Accepting transmitted data that’s addressed to it.

n

Repeaters/Hubs – Accepts transmitted signals, amplify it and puts them back on the network NIC, OSI Reference Model 7

Network Basics : Software n

Protocol – – –

Are standards that allow computer to communicate. Define how computer identify one another on a network How information be processed once it reach its final destination. – Define procedure for handling lost or damaged packets. n

Device Drivers – Is a hardware level program that control NIC – NIC, provide an interface for its host’ operating system

n

Communication Software – That enable the users to communicate and share resources » Windows Explorer, WWW, Telnet, FTP NIC, OSI Reference Model

8

Networking Basics: LAN Hardware and Software are to be integrated to make a LAN n Repeater-less LAN n

n

Hub Based LAN

NIC, OSI Reference Model

9

Networking Basics : LAN

NIC, OSI Reference Model

10

Networking Basics : LAN

NIC, OSI Reference Model

11

Multiaccess vs. Point-to-point n

Multiaccess means shared medium. – many end-systems share the same physical communication resources (wire, frequency, ...) – There must be some arbitration mechanism.

n

Point-to-point – only 2 systems involved – no doubt about where data came from ! NIC, OSI Reference Model

12

Multiaccess

Point-to-point

NIC, OSI Reference Model

13

LAN - Local Area Network n

connects computers that are physically close together ( < 1 mile). – high speed – multi-access

n

Technologies: – Ethernet 10 Mbps, 100Mbps – Token Ring 16 Mbps – FDDI 100 Mbps NIC, OSI Reference Model

14

WAN - Wide Area Network n

connects computers that are physically far apart. “long-haul network”. – typically slower than a LAN. – typically less reliable than a LAN. – point-to-point

n

Technologies: – telephone lines – Satellite communications NIC, OSI Reference Model

15

MAN - Metropolitan Area Network n

Larger than a LAN and smaller than a WAN - example: campus-wide network - multi-access network

n

Technologies: – coaxial cable – Microwave (Wireless Technology) NIC, OSI Reference Model

16

Internetwork Connection of 2 or more distinct (possibly dissimilar) networks. n Requires some kind of network device to facilitate the connection. n

Net A

Net B NIC, OSI Reference Model

17

Network Models Using a formal model allows us to deal with various aspects of Networks abstractly. n We will look at a popular model (OSI reference model). n The OSI reference model is a layered model. n

NIC, OSI Reference Model

18

OSI Reference Model The International Organization for standardization (ISO) proposed for the standardization of the various protocols used in computer networks (specifically those networks used to connect open systems) is called the Open Systems Interconnection Reference Model (1984), or simply the OSI model. NIC, OSI Reference Model

19

OSI Model Although the OSI model is a just a model (not a specification), it is generally regarded as the most complete model (as well it should be - nearly all of the popular network protocol suites in use today were developed before the OSI model was defined).

NIC, OSI Reference Model

20

OSI 7 Layer Model: 7 6 5 4 3 2 1

Application Presentation Session Transport Network Data-Link Physical

High level protocols

Low level protocols

NIC, OSI Reference Model

21

Layering Divide a task into pieces and then solve each piece independently (or nearly so). n Establishing a well defined interface between layers makes porting easier. n Major Advantages: n

♦ Code Reuse ♦ Extensibility

NIC, OSI Reference Model

22

Layering Example: Postal deptt. Letter in envelope, address on outside n Adds addressing information, pincode. n Local office drives to airport and delivers to hub. n Sent via airplane to nearest city. n Delivered to right office n Delivered to right person n

NIC, OSI Reference Model

23

Layers Letter

Addressed Envelope

Letter

Addressed Envelope

NIC, OSI Reference Model

24

OSI model consists of seven layers

NIC, OSI Reference Model

25

Layering & Headers n n n

Each layer needs to add some control information to the data in order to do it’s job. This information is typically prepended to the data before being given to the lower layer. Once the lower layers deliver the data and control information - the peer layer uses the control information.

NIC, OSI Reference Model

26

Headers DATA

Process

H

DATA

Transport

H H

DATA

Network

H H H

DATA

Data Link

Process

Transport

Network

Data Link

NIC, OSI Reference Model

27

The upper (3) layers n

Primarily concerned with the application, or what the user can see. » FTP » Telnet » SNMP

NIC, OSI Reference Model

28

Mid (Layers 3-5) n

often referred to as transport protocols and are primarily concerned with establishing and maintaining (logical) connections and resolving network names. » TCP/IP » IPX/SPX » NetBEUI » Net BIOS » DEC net » Appletalk

NIC, OSI Reference Model

29

Lower Level Protocols n

(Physical Layer Standards) » 802.3 (8802.3)Ethernet » 802.4 (8802.4)Token Bus » 802.5 (8802.5)Token Ring (4 Mbps, 16 Mbps) » FDDI » ATM

NIC, OSI Reference Model

30

OSI from the bottom up

NIC, OSI Reference Model

31

The Physical Layer n

Responsibility: – transmission of raw bits over a communication channel.

n

Issues: – mechanical and electrical interfaces – time per bit – distances

NIC, OSI Reference Model

32

n n

Cables (or wireless) are often referred to as the "medium” “media” Most common media types: – Fiber-optic Cable – Unshielded-Twisted Pair (UTP-100mts, 10100mnps) – Coaxial Cable (Thin-185mts,10mbps, Thick500mts,10mbps) – Shielded Twisted Pair (STP)

n

These cables are used to carry digital signals between devices. NIC, OSI Reference Model

33

NIC, OSI Reference Model

34

NIC, OSI Reference Model

35

Analog Signaling n

n

analog signals can be represented by a sine wave Data in the form of 0s and 1s is extracted from analog signals through various voltage and frequency modulation techniques.

NIC, OSI Reference Model

36

Digital Signaling n

n

LANs use digital singling to transfer their data. 0s and 1s are represented with or conveyed through the use of positive and negative voltages. A negative voltage might represent a 0, while a positive voltage might represent a 1.

NIC, OSI Reference Model

37

Encoding n

n

Now it might be easy, but not efficient to have a positive voltage represent a 0 and a negative voltage represent a 1. Because of this inefficiency, various "encoding schemes" use changes in voltages to represent one bit or the other, rather than just using a positive or negative voltage to represent the two states. Encoding schemes seek to efficiently utilize voltage variations to turn 0s and 1s into voltages which can be transferred over a cable (media).

NIC, OSI Reference Model

38

Manchester Encoding 0

0

1

0

1

1

n

Probably the most well known encoding scheme is "Manchester Encoding”

n

Manchester encoding uses a transition during each bit period (duration) for synchronization as well as data. So, if the voltages changes from a low or negative voltage to a high or positive voltage in the middle of its bit period, a binary 1 is transmitted. The transition from positive to negative voltage in the middle of the bit period represents a binary 0.

NIC, OSI Reference Model

39

The Data Link Layer Data Link Control n

Responsibility: – provide an error-free communication link

n

Issues: – framing (dividing data into chunks) » header & trailer bits

– addressing 10110110101

01100010011 NIC, OSI Reference Model

10110000001

40

Data Link Layer n

Transmit – Encapsulates packet from Internet Layer in frame add header for addressing and trailer for error control – Header says “00-A0-CC-39-2D-78, I’m talking’ to you” – Uses the physical layer to transmit frame

n

Receive – – – –

Uses physical layer to receive data Identifies address, “You talking’ to me?” Performs necessary error recovery Delivers data to layer above NIC, OSI Reference Model

41

OSI Layer 2. Data-Link Layer

NIC, OSI Reference Model

42

Media Access Control:

Sharing the Wire n n

n n n

Broadcast a frame onto the medium. All nodes on the shared medium see the message, but ignore it unless it is addressed to them. Media access control (MAC) refers to the need to control when devices transmit. MAC makes sure no two devices attempt to transmit data at the same time. Essentially using Statistical TDMA NIC, OSI Reference Model

43

Media Access Control:

Media Access Control Methods Contention Simultaneous Listen then talk 2 talking causes a collision

Token Passing Controlled Access

Sequentially take turns Talk/Listen NIC, OSI Reference Model

44

Media Access Control:

Relative Performance In general, contention approaches work better than controlled approaches for small networks that have low usage. In high volume networks, many devices want to transmit at the same time, and a wellcontrolled circuit prevents collisions. NIC, OSI Reference Model

45

Efficiency:

Data & Transmission Efficiency Data field holds 46 bytes to 1500 bytes n Transmission efficiency - information bits divided by total number of bits n Ethernet Efficiency = 1500 / (1500 + 26) = 96.7% n

NIC, OSI Reference Model

46

CSMA/CD (IEEE 802.3) Carrier-Sense Multiple Access with Collision Detection

The most common MAC layer access method in Local Area Networks n CSMA/CD based protocol for the transmission of data at 10/100 Mbps. – Medium Access – Transmission – Collisions Detection – Re-Transmission n

NIC, OSI Reference Model

47

Ethernet / CSMA/CD Stations wishing to transmit listen to the line to determine if it is in use. n If no is heard, the station will transmit a message called a “frame”. n Every computer "hears" every transmission, but only the "destination" computer listens to the message. n All other stations 'filter' or disregard transmissions not addressed to them. n

NIC, OSI Reference Model

48

Ethernet Variations n

Ethernet runs over a variety of cable types at 10 Mbps. – 10Base2 – 10Base5 – 10BaseF – 10BaseT – 100BaseT – 1000BaseT NIC, OSI Reference Model

49

Broadband vs. Baseband n n

Broadband Signaling

n n

transmission system that multiplexes multiple independent signals onto one cable. In telecommunications terminology, any channel having a bandwidth greater than a voice-grade channel (4 kHz). In LAN terminology, a coaxial cable on which analog signaling is used. Also called wideband.

Baseband Signaling Characteristic of a network technology where only one carrier frequency is used. Ethernet is an example of a baseband network. Also called narrowband.

NIC, OSI Reference Model

51

The Network Layer n

Responsibilities: – path selection between end-systems (routing). – subnet flow control. – fragmentation & reassembly – translation between different network types.

n

Issues: – packet headers – virtual circuits NIC, OSI Reference Model

52

Network layer header examples protocol suite version n type of service n length of the data n packet identifier n fragment number n time to live n

protocol n header checksum n source network address n destination network address n

NIC, OSI Reference Model

53

The Transport Layer n

Responsibilities: – provides virtual end-to-end links between peer processes. – end-to-end flow control

n

Issues: – headers – error detection – reliable communication NIC, OSI Reference Model

54

Modes of Service connection-oriented vs. connectionless n sequencing n error-control n flow-control n byte stream vs. message based n full-duplex vs. half-duplex. n

NIC, OSI Reference Model

55

Connection-Oriented vs. Connectionless Service n

A connection-oriented service includes the establishment of a logical connection (circuit) between 2 processes. – – –

n

establish logical connection transfer data terminate connection.

Connectionless services involve sending of independent messages.

NIC, OSI Reference Model

56

Sequencing Sequencing provides support for an order to communications. n A service that includes sequencing requires that messages (or bytes) are received in the same order they are sent. n

NIC, OSI Reference Model

57

Every IP datagram is an individual entity and may take a different route

NIC, OSI Reference Model

58

Error Control Some services require error detection (it is important to know when a transmission error has occured). n Checksums provide a simple error detection mechanism. n Error control sometimes involves notification and retransmission. n

NIC, OSI Reference Model

59

Flow Control Flow control prevents the sending process from overwhelming the receiving process. n Flow control can be handled a variety of ways - this is one of the major research issues in the development of the next generation of networks (ATM). n

NIC, OSI Reference Model

60

Byte Stream vs. Message Byte stream implies an ordered sequence of bytes with no message boundaries. n Message oriented services provide communication service to chunks of data called datagrams. n

NIC, OSI Reference Model

61

Full- vs. Half-Duplex n

Full-Duplex services support the transfer of data in both directions.

n

Half-Duplex services support the transfer of data in a single direction.

NIC, OSI Reference Model

62

End-to-End vs. Hop-toHop n

Many service modes/features such as flow control and error control can be done either: between endpoints of the communication. -orbetween every 2 nodes on the path between the endpoints.

NIC, OSI Reference Model

63

End-to-End Process A

Process B

NIC, OSI Reference Model

64

Hop-by-Hop Process A

Process B

NIC, OSI Reference Model

65

Buffering n n

Buffering can provide more efficient communications. Buffering is most useful for byte stream services.

Process A

Send Buffer

Recv. Buffer

NIC, OSI Reference Model

Process B

66

The Session Layer n

Responsibilities: – establishes, manages, and terminates sessions between applications. – service location lookup

n

Many protocol suites do not include a session layer. NIC, OSI Reference Model

67

The Presentation Layer n

Responsibilities: – data encryption – data compression – data conversion

n

Many protocol suites do not include a Presentation Layer.

NIC, OSI Reference Model

68

The Application Layer n

Responsibilities: – anything not provided by any of the other layers

n

Issues: – application level protocols – appropriate selection of “type of service”

NIC, OSI Reference Model

69

Application Layer n

n

Function – to define a standard set of commands understood by clients and servers irrespective of underlying platform Request / Response model

NIC, OSI Reference Model

70

Important Summary Data-Link :- communication between machines on the same network. n Network :- communication between machines on possibly different networks. n Transport :- communication between processes (running on machines on possibly different networks). n

NIC, OSI Reference Model

71

Connecting Networks n

Repeater:

physical layer

n

Bridge:

data link layer

n

Router:

network layer

n

Gateway:

network layer and above.

NIC, OSI Reference Model

72

Repeater Copies bits from one network to another n Does not look at any bits n Allows the extension of a network beyond physical length limitations n

REPEATER

NIC, OSI Reference Model

73

Bridge Copies frames from one network to another n Can operate selectively - does not copy all frames (must look at data-link headers). n Extends the network beyond physical length limitations. n

BRIDGE NIC, OSI Reference Model

74

Router Copies packets from one network to another. n Makes decisions about what route a packet should take (looks at network headers). n

ROUTER ROUTER

NIC, OSI Reference Model

75

Gateway Operates as a router n Data conversions above the network layer. n Conversions: n

encapsulation - use an intermediate network translation - connect different application protocols encryption - could be done by a gateway NIC, OSI Reference Model

76

Encapsulation Example Gateway

n

Gateway

Provides service connectivity even though intermediate network does not support protocols. NIC, OSI Reference Model

77

Translation Gateway

n

Translate from green protocol to brown protocol

NIC, OSI Reference Model

78

Encryption gateway Secure Network

Encryption/Decryption Gateways

GW

? ? ?

Secure Network

GW

Insecure Network

NIC, OSI Reference Model

79

Hardware vs. Software Repeaters are typically hardware devices. n Bridges can be implemented in hardware or software. n Routers & Gateways are typically implemented in software so that they can be extended to handle new protocols. n Many workstations can operate as routers or gateways. n

NIC, OSI Reference Model

80

TCP/IP Transmission Control Protocol / Internet Protocol

NIC, OSI Reference Model

81

TCP/IP & OSI In OSI reference model terminology -the TCP/IP protocol suite covers the network and transport layers. n TCP/IP can be used on many data-link layers (can support many network hardware implementations). n

NIC, OSI Reference Model

82

Comparison of OSI model with TCP/IP model

NIC, OSI Reference Model

83

Internet Protocol The IP in TCP/IP n

IP is the network layer – packet delivery service (host-to-host). – translation between different data-link protocols.

NIC, OSI Reference Model

84

IP Datagrams IP provides connectionless, unreliable delivery of IP datagrams. n Connectionless: each datagram is independent of all others. n Unreliable: there is no guarantee that datagrams are delivered correctly or at all. n

NIC, OSI Reference Model

85

n

IP addresses are not the same as the underlying data-link (MAC) addresses.

R e n s s e l a e r

IP Addresses

Why ? NIC, OSI Reference Model

86

IP Addresses IP is a network layer - it must be capable of providing communication between hosts on different kinds of networks (different data-link implementations). n The address must include information about what network the receiving host is on. This makes routing feasible. n

NIC, OSI Reference Model

87

IP Addresses IP addresses are logical addresses (not physical) n 32 bits. n Includes a network ID and a host ID. n Every host must have a unique IP address. n IP addresses are assigned by a central authority (the Inter-NIC at SRI International). n

NIC, OSI Reference Model

88

The four formats of IP Addresses

Class A 00 NetID NetID B 10 10

HostID HostID

NetID NetID

C

110 110

D

1110 8 bits

HostID HostID HostID HostID

NetID NetID

Multicast Address 8 bits

8 bits

NIC, OSI Reference Model

8 bits

89

Class Class AA l l 128 128 possible possible network network IDs IDs l l over over 44 million million host host IDs IDs per per network network ID ID

Class Class BB l l 16K 16K possible possible network network IDs IDs l l 64K 64K host host IDs IDs per per network network ID ID Class Class C C l l over over 22 million million possible possible network network IDs IDs l l about about 256 256 host host IDs IDs per per network network ID ID NIC, OSI Reference Model

90

Network and Host IDs A Network ID is assigned to an organization by a global authority. n Host IDs are assigned locally by a system administrator. n Both the Network ID and the Host ID are used for routing. n

NIC, OSI Reference Model

91

IP Addresses IP Addresses are usually shown in dotted decimal notation: 1.2.3.4 00000001 00000010 00000011 00000100 n cs.rpi.edu is 128.213.1.1 n

10000000 11010101 00000001 00000001

CS has a class B network NIC, OSI Reference Model

92

Host and Network Addresses A single network interface is assigned a single IP address called the host address. n A host may have multiple interfaces, and therefore multiple host addresses. n Hosts that share a network all have the same IP network address (the network ID). n

NIC, OSI Reference Model

93

IP Broadcast and Network Addresses An IP broadcast addresses has a host ID of all 1s. n IP broadcasting is not necessarily a true broadcast, it relies on the underlying hardware technology. n An IP address that has a host ID of all 0s is called a network address and refers to an entire network. n

NIC, OSI Reference Model

94

Mapping IP Addresses to Hardware Addresses IP Addresses are not recognized by hardware. n If we know the IP address of a host, how do we find out the hardware address ? n The process of finding the hardware address of a host given the IP address is called Address Resolution n

NIC, OSI Reference Model

95

Reverse Address Resolution n

The process of finding out the IP address of a host given a hardware address is called Reverse Address Resolution

n

Reverse address resolution is needed by diskless workstations when booting. NIC, OSI Reference Model

96

ARP The Address Resolution Protocol is used by a sending host when it knows the IP address of the destination but needs the Ethernet address. n ARP is a broadcast protocol - every host on the network receives the request. n Each host checks the request against it’s IP address - the right one responds. n

NIC, OSI Reference Model

97

ARP (cont.) ARP does not need to be done every time an IP datagram is sent - hosts remember the hardware addresses of each other. n Part of the ARP protocol specifies that the receiving host should also remember the IP and hardware addresses of the sending host. n

NIC, OSI Reference Model

98

ARP conversation HEY - Everyone please listen! Will 192.168.0.44 please send me his/her Ethernet address?

not me

Hi Green! I’m 192.168.0.44, and my Ethernet address is 87:A2:15:35:02:C3 NIC, OSI Reference Model

99

RARP conversation HEY - Everyone please listen! My Ethernet address is 22:BC:66:17:01:75. Does anyone know my IP address ?

not me

Hi Green! Your IP address is 128.213.1.17. NIC, OSI Reference Model

100

Services provided by IP Connectionless Delivery (each datagram is treated individually). n Unreliable (delivery is not guaranteed). n Fragmentation / Reassembly (based on hardware MTU). n Routing. n Error detection. n

NIC, OSI Reference Model

101

IP Datagram 1 byte

1 byte

1 byte

1 byte

VERS

HL Service Fragment Length Datagram ID FLAG Fragment Offset TTL Protocol Header Checksum Source Address Destination Address Options (if any) Data

NIC, OSI Reference Model

102

IP Datagram Fragmentation Each fragment (packet) has the same structure as the IP datagram. n IP specifies that datagram reassembly is done only at the destination (not on a hop-by-hop basis). n If any of the fragments are lost - the entire datagram is discarded (and an ICMP message is sent to the sender). n

NIC, OSI Reference Model

103

IP Flow Control & Error Detection If packets arrive too fast - the receiver discards excessive packets and sends an ICMP message to the sender (SOURCE QUENCH). n If an error is found (header checksum problem) the packet is discarded and an ICMP message is sent to the sender. n

NIC, OSI Reference Model

104

ICMP Internet Control Message Protocol ICMP is a protocol used for exchanging control messages. n ICMP uses IP to deliver messages. n ICMP messages are usually generated and processed by the IP software, not the user process. n

NIC, OSI Reference Model

105

ICMP Message Types Echo Request n Echo Response n Destination Unreachable n Redirect n Time Exceeded n Redirect (route change) n there are more ... n

NIC, OSI Reference Model

106

Process Process

Process Process

TCP TCP

UDP UDP

ICMP, ARP & RARP

Process Layer

Transport Layer

Network Layer

IP IP

802.3 802.3 NIC, OSI Reference Model

Data-Link Layer 107

UDP User Datagram Protocol n

UDP is a transport protocol – communication between processes

UDP uses IP to deliver datagrams to the right host. n UDP uses ports to provide communication services to individual processes. n

NIC, OSI Reference Model

108

Ports TCP/IP uses an abstract destination point called a protocol port. n Ports are identified by a positive integer. n Operating systems provide some mechanism that processes use to specify a port. n

NIC, OSI Reference Model

109

Ports Host A

Host B

Process

Process

Process

Process

Process

Process

NIC, OSI Reference Model

110

UDP Datagram Delivery n Connectionless n Unreliable n Minimal n

UDP Datagram Format Source Port

Destination Port

Length

Checksum Data

NIC, OSI Reference Model

111

TCP Transmission Control Protocol TCP is an alternative transport layer protocol supported by TCP/IP. n TCP provides: – Connection-oriented – Reliable – Full-duplex – Byte-Stream n

NIC, OSI Reference Model

112

Connection-Oriented Connection oriented means that a virtual connection is established before any user data is transferred. n If the connection cannot be established - the user program is notified. n If the connection is ever interrupted the user program(s) is notified. n

NIC, OSI Reference Model

113

Reliable Reliable means that every transmission of data is acknowledged by the receiver. n If the sender does not receive acknowledgement within a specified amount of time, the sender retransmits the data. n

NIC, OSI Reference Model

114

Byte Stream Stream means that the connection is treated as a stream of bytes. n The user application does not need to package data in individual datagrams (as with UDP). n

NIC, OSI Reference Model

115

Buffering TCP is responsible for buffering data and determining when it is time to send a datagram. n It is possible for an application to tell TCP to send the data it has buffered without waiting for a buffer to fill up. n

NIC, OSI Reference Model

116

Full Duplex TCP provides transfer in both directions. n To the application program these appear as 2 unrelated data streams, although TCP can piggyback control and data communication by providing control information (such as an ACK) along with user data. n

NIC, OSI Reference Model

117

TCP Ports Interprocess communication via TCP is achieved with the use of ports (just like UDP). n UDP ports have no relation to TCP ports (different name spaces). n

NIC, OSI Reference Model

118

TCP Segments The chunk of data that TCP asks IP to deliver is called a TCP segment. n Each segment contains: n

– data bytes from the byte stream – control information that identifies the data bytes

NIC, OSI Reference Model

119

TCP Segment Format 1 byte

1 byte

1 byte

1 byte

Source Port Destination Port Sequence Number Request Number offset Reser. Control Window Checksum Urgent Pointer Options (if any) Data NIC, OSI Reference Model

120

Addressing in TCP/IP n

Each TCP/IP address includes: – Internet Address – Protocol (UDP or TCP) – Port Number

NIC, OSI Reference Model

121

TCP vs. UDP Q: Which protocol is better ? A: It depends on the application. TCP provides a connection-oriented, reliable byte stream service (lots of overhead). UDP offers minimal datagram delivery service (as little overhead as possible). NIC, OSI Reference Model

122

TCP/IP Summary n

IP: network layer protocol – unreliable datagram delivery between hosts.

n

UDP: transport layer protocol – unreliable datagram delivery between processes.

n

TCP: transport layer protocol – reliable, byte-stream delivery between processes. NIC, OSI Reference Model

123

IP Addressing and Sub-netting

NIC, OSI Reference Model

124

IP Address Management n

Managed by the IANA – (Internet Assigned Numbers Authority)

Host IP addresses are assigned by the network administrator. n Managed Statically or Dynamically. n

NIC, OSI Reference Model

125

IP v4 Ipv4 uses 32 bit unique addresses n Displayed in 4 part (field, byte) dotted decimal notation. n

– xxx.xxx.xxx.xxx

NIC, OSI Reference Model

126

Breaking down the Bytes n

Each of the 4 bytes can be broken into a unit of 8 bits. – 10101110.11111000.01100110.00000110

NIC, OSI Reference Model

127

Calculating Byte Values Each Bit has a value. n Calculation starts on the left with the “High order bit” n 128+64+32+16+8+4+2+1 = 11111111 n 01111111 = 64+32+16+8+4+2+1 n 10111111 = 128+32+16+8+4+2+1 n

NIC, OSI Reference Model

128

Network Address Class Determination n

5 Classes of IP addresses can be created by changing the value of the high order bits in the first byte.

NIC, OSI Reference Model

129

Classes of networks Class A n Class B n Class C n Class D n

NIC, OSI Reference Model

130

Specifying Classes Class A High Order Bit 0 n Class B High Order Bits 10 n Class C High Order Bits 11 n Class D High Order Bits 1110 n Class E High Order Bits 11110 n

NIC, OSI Reference Model

131

Class A Addresses Up to 126 addresses n Up to 16,777,216 hosts each. n 1-126.xxx.xxx.xxx n 0 and 127 are reserved n 10.0.0.0 - 10.255.255.255 are Private Reserved (Non-Routable Class A Addresses) n

NIC, OSI Reference Model

132

Class B Addresses up to 16,384 Networks n Each network with 65,000 addresses n 128-191.xxx.xxx.xxx n Private / Reserved Class B Addresses 172.16.0 - 172.31.255.255 n

NIC, OSI Reference Model

133

Class C Addresses Up to 2,097,152 class C networks with 254 addresses each n (0 and 255 are reserved) n The first two high order bits must be 1 & 1. n 192-254.xxx.xxx.xxx n Private Reserved Class C Addresses 192.168.0.0 - 192.168.255.255 n

NIC, OSI Reference Model

134

Class D & E n

n

Class D- used for multicasting High Order bits set to 1110 224.0.0.0-239.xxx.xxx.xxx Class D addresses can not be assigned to hosts. Class E- experimental High order bits set to 11110 240-247.xxx.xxx.xxx Class E addresses can not be assigned to hosts NIC, OSI Reference Model

135

Private (Reserved Addresses) Class A 10.0.0.0 - 10.255.255.255 n Class B 172.16.0 - 172.31.255.255 n Class C 192.168.0.0 - 192.168.255.255 n

n

Network Portion of address in a Subnet must not = all 1s or all 0s

NIC, OSI Reference Model

136

Subnet Addresses n n

An organization can subdivide it’s host address space into groups called subnets. The subnet ID is generally used to group hosts based on the physical network topology.

10 10

NetID NetID

SubnetID SubnetID HostID HostID

NIC, OSI Reference Model

137

Subnetting router

Subnet 1 128.213.1.x

Subnet 2 128.213.2.x

NIC, OSI Reference Model

Subnet 3 128.213.3.x

138

Subnetting Subnets can simplify routing. n IP subnet broadcasts have a hostID of all 1s. n It is possible to have a single wire network with multiple subnets. n

NIC, OSI Reference Model

139

Sub-netting Sub-nets- Sub-nets divide a single network into smaller networks. n Routers are used to connect the smaller Subnetworks to the main network. n Subnetting borrows host bits and adds them to the main network's section. n

NIC, OSI Reference Model

140

Sub Network Borrowing [x][xxxxxxx] (x=0 or 1) n ^ Network ^ Hosts n

NIC, OSI Reference Model

141

Sub-netting Sub-nets- Sub-nets divide a single network into smaller networks. n Routers are used to connect the smaller Subnetworks to the main network. n Subnetting borrows host bits and adds them to the main network's section. n Subnet Mask- tells TCP/IP which bits have been borrowed for sub-netting. n

NIC, OSI Reference Model

142

NIC, OSI Reference Model

143

Subnet Mask Continued n

Flat networks are networks which do not employ subnets. – IP Address 137.150.64.1= – 10001001.10010110.01000000.00000001 – Subnet Mask 255.255.0.0 – 11111111.11111111.00000000.00000000

NIC, OSI Reference Model

144

Subnet Mask Cont. n

The Subnet Mask identifies which portion of the address is used for the network, and which portion is used for the host.

NIC, OSI Reference Model

145

Common Subnets n 255 11111111 n 254 11111110 n 252 11111100 n 248 11111000 n 240 11110000 n 224 11100000 n 192 11000000 n 128 10000000 n 0

0

NIC, OSI Reference Model

146

Theoretical Networks Created Number of Host Bits Sub Used Networks 2

1 bits

4

2 bits

8

3 bits

16

4 bits

32

5 bits

64

6 bits

128

7 bits

255

8 bits NIC, OSI Reference Model

147

Class A Subnet Table n n n n n n n n n

# of Subnets 0 2 6 14 30 62 126 254

Hosts per subnet invalid 4,194,302 2,097,150 1,048,574 524,286 262,142 131,070 65,534

Number of bits 1 2 3 4 5 6 7 8

NIC, OSI Reference Model

Subnet Mask invalid 255.192.0.0 255.224.0.0 255.240.0.0 255.248.0.0 255.252.0.0 255.254.0.0 255.255.0.0

148

Class B Subnet Table n n n n n n n n n

# of Subnets 0 2 6 14 30 62 126 254

Hosts per subnet invalid 16,382 8,190 4,094 2,046 1,022 510 254

Number of bits 1 2 3 4 5 6 7 8

NIC, OSI Reference Model

Subnet Mask invalid 255.255.192.0 255.255.224.0 255.255.240.0 255.255.248.0 255.255.252.0 255.255.254.0 255.255.255.0

149

Class C Subnet Table n n n n n n n

# of Subnets 0 2 6 14 30 62

Hosts per subnet invalid 62 30 14 6 2

Number of bits 1 2 3 4 5 6

NIC, OSI Reference Model

Subnet Mask invalid 255.255.255.192 255.255.255.224 255.255.255.240 255.255.255.248 255.255.255.252

150

Calculating First and Last Address n

When bits are borrowed from the host portion of the address and given to the network portion of the address, the ranges of address should consist of a network address and a first and last host address.

NIC, OSI Reference Model

151

Class B Example 172.16.xxx.xxx n 255.255.224.0 n 3 subnet bits taken n 8 subnets created 8190 hosts each n

NIC, OSI Reference Model

152

Class B: 3 3bit Address Ranges 0 [000]172.16.0.1 to 172.16.31.254 n 1 [001]172.16.32.1 to 172.16.63.254 n 2 [010]172.16.64.1 to 172.16.95.254 n 3 [011]172.16.96.1 to 172.16.127.254 n 4 [100]172.16.128.1 to 172.16.159.254 n 5 [101]172.16.160.1 to 172.16.191.254 n 6 [110]172.16.192.1 to 172.16.223.254 n 7 [111]172.16.224.1 to 172.16.255.254 n

NIC, OSI Reference Model

153

Class C Addresses : 2 bits Subnet Mask 255.255.255.192 n 4 Subnets 62 hosts each n

0 192.168.121.1 to 192.168.121.62 n 1 192.168.121.65 to 192.168.121.126 n 2 192.168.121.129 to 192.168.121.190 n 3 192.168.121.193 to 192.168.121.254 n

NIC, OSI Reference Model

154

Class C Example : Continued 2 subnet bits = [xx][xxxxxx] n All 0 and 1 hosts are excluded n Possible network addresses n 0 = [00][xxxxxx] n 64 = [01][xxxxxx] n 128= [10][xxxxxx] n 192= [11][xxxxxx] n

NIC, OSI Reference Model

155

Class C Example: Bit Counting n

0

= [00][xxxxxx] .1 to .62

– [00][000001] to [00][111110] n

64 = [01][xxxxxx] .65 to .126 – [01][000001] to [01][111110]

n

128= [10][xxxxxx] .129 to .190 – [10][000001] to [10][111110]

n

192= [11][xxxxxx] .193 to .254 – [11][000001] to [11][111110] NIC, OSI Reference Model

156

Subnet Calculations & Calculators Be careful when converting decimal to binary that bits are not dropped. n Sub-net Calculators are available and can be used to calculate address ranges and network addresses for hosts. n

NIC, OSI Reference Model

157

IP Version 6 n Necessary because we are running out of 32

bit IPv4 Addresses. And Routing Tables are becoming too large. n IP v6 uses 128 bit addresses n IP v 6 Equipment will also support IPv4.

NIC, OSI Reference Model

158