115
www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrum Room 5D03B Tel: 90 366364 voice mail on 6 th ring Email: [email protected] Web site: http://www.eej.ulst.ac.uk Lecture 7: Aspects of Ethernet This version Modified 03/12/06

Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

Embed Size (px)

Citation preview

Page 1: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96

COM347J1Networks and Data Communications

Ian McCrum Room 5D03B

Tel: 90 366364 voice mail on 6th ring

Email: [email protected]

Web site: http://www.eej.ulst.ac.uk

Lecture 7: Aspects of Ethernet

This versionModified03/12/06

Page 2: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/2/96

The IEEE 802 Standards

• The IEEE 802 Standards (also known as ISO 8802) lay down a set of guide lines as to how a range of common networks should work.

• The IEEE 802.1 Standard describes the architecture, general management, addressing and internetworking of IEEE 802 networks.

• The IEEE 802.2 Standard describes the interface between the Network Layer and the Data Link Layer.– This standardised interface is called Logical Link Control

(LLC) and allows the software from the Network Layer upwards to be ported from one IEEE 802 LAN to another.

Page 3: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/3/96

IEEE 802.2: Logical Link Control

• Logical Link Control (LLC) is essentially a sub-layer in the Data Link Layer of IEEE 802 networks.

– It forms the upper half of the Data Link Layer while Medium Access Control (MAC) forms the bottom half.

• The Network Layer passes its packets to the Data Link Layer using the LLC access primitives.

– The LLC adds its own header containing sequence numbers and piggy-backed acknowledgement numbers.

– The resulting structure is then passed to the MAC.

MAC

Physical Layer

LLC

Network Layer

Data Link Layer

MAC

Network

LLC

Packet

Packet

LLC Packet MAC

Page 4: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/4/96

IEEE 802.2: Logical Link Control

• The LLC offers three types of service tothe Network Layer:– Unreliable datagram service - this type of connectionless service does not

bother with acknowledgements. It is mainly used for sending status information.

– Acknowledged datagram service - still connectionless but this time packets are acknowledged and retransmitted if they are corrupted or go missing.

– Reliable connection-oriented service - packets are passed up to the Network Layer in the order they were transmitted. Packets are acknowledge and are retransmitted if they are corrupted or go missing.

MAC

Physical Layer

LLC

Network Layer

LLC is based on an older protocol calledHigh-level Data Link Control (HDLC)

Page 5: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/5/96

Medium Access Control

• IEEE 802.3, 802.4 and 802.5 describes the Medium Access Control (MAC) for CSMA/CD Bus, Token Bus and Token Ring LANs respectively.

• The roles MAC sub-layer are to determine when a frame can be transmitted, transmit the frame and to extract incoming frames from the bit stream (presented to it by the Physical Layer).

• The MAC sub-layer is particularly important in broadcast networks. This is because the MAC layer deals with the problem of contention (i.e. the situation when two hosts want to transmit at the same time).

MAC

Physical Layer

LLC

Network Layer

Page 6: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/6/96

Multiple Access (MA)

• To help us understand the sort of problems MAC may have to deal with, imagine a bus topology that uses a single cable to connect multiple hosts.

• If any host is allowed to transmit data over this cable then there is a multiple access (MA) channel between the hosts.

• Such a network is actually viable. Each host can send a frame at any time and, as long as the network is not being used by another host, the destination host can receive it.

Communication Link

Page 7: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/7/96

Carrier Sense, Multiple Access (CSMA)

• With just Multiple Access, wecan make a cheap and simple network. However, if a host transmits a frame while another host is transmitting then both frames will be garbled. This is known as a collision.

• We can improve the performance of our simple network greatly if we introduce carrier sensing (CS). With carrier sensing, each host listens to the data being transmitted over the cable.– A host will only transmit its own frames when it cannot

hear any data being transmitted by other hosts.– When a frame finishes, an interframe gap of about

9.6sec is allowed to pass before another host starts transmitting its frame.

Communication Link

Page 8: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/8/96

Collision Detection (CD)

• Now and again two hosts will attempt to transmit a frame at exactly the same time. Even carrier sensing will not help in this case because both hosts will already be transmitting before they hear the other host’s data.– This happens more often than you would think. There is a small

time lag as data propagates along the cable. This means there is a realistic window of opportunity for both hosts to start transmitting without detecting the other.

• Both frames will, of course, be garbled. The best thing to do is for both hosts to abandon the transmission of their frames and to try again later.– This is done by getting the hosts to listen to the data on the cable

and comparing it to the data they are transmitting. If they are different then a collision must have occurred!

Page 9: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/9/96

Collision Detection (CD)

• To ensure that the other hosts knows a collision has occurred as soon as possible, the first host to detect a collision will transmit a 48-bit burst of random data called a jam sequence.– This is just to make doubly sure that any hosts currently

transmitting know to abandon their transmissions.

• After a suitable interval (the time it takes for the jam sequence to propagate along the whole network plus the interframe gap) the hosts can attempt to retransmit their frames.– But, if the collision was due to two hosts transmitting at

exactly the same time, what is to stop them from transmitting at the same time again and again?

Page 10: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/10/96

Binary Exponential Back-off Algorithm

• Rather than having two hosts (or occasionally more) attempting to retransmit their frames immediately after the interval, they wait for a random period of time.– It is unlikely that both hosts will wait for exactly the same

time period and so a stalemate situation can be avoided.

• After the first collision, a host will typically wait 0 or 1 time units (usually 1 unit = 51.2sec).

• If a collision occurs again, it will wait 0,1,2 or 3 time units.– And so on. After n collisions a host will randomly choose

to wait between 0 and 2n-1 time units.– After 10 successive collisions, a host will typically give up

and report to its user than it cannot transmit the data.

Page 11: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/11/96

IEEE 802.3: CSMA/CD Bus LAN

• The 802.3 standard describes the operation of the MAC sub-layer in a bus LAN that uses carrier sense, multiple access with collision detection (CSMA/CD).

– Beside carrier sensing, collision detection and the binary exponential back-off algorithm, the standard also describes the format of the frames and the type of encoding used for transmitting frames.

– The minimum length of frames can be varied from network to network. This is important because, depending on the size of the network, the frames must be of a suitable minimum length.

– The standard also makes some suggestions about the type of cabling that should be used for CSMA/CD bus LANs.

• The CSMA/CD Bus LAN is also widely called Ethernet.

Page 12: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/12/96

IEEE 802.3: Cable Types

• There are four types of cable use for CSMA/CD bus LANs. The most common are 10Base2 (a.k.a. thin Ethernet) and 10Base-T (a.k.a. category 5 UTP).

(a) 10Base5

(b) 10Base2

(c) 10Base-T

NAME CABLE SEG.LENGTH NODES/SEG. CONNECTORS ADVANTAGES10Base5 thick coaxial 500m 100 vampire taps Good backbone10Base2 thin coaxial 200m 30 BNC (T-junc) Cheap10Base-T twisted pair 100m 1024 telephone like Easy maintenance10Base-F fibre optic 2000m 1024 expensive Low noise

Page 13: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/13/96

IEEE 802.3: Frame Format

• Regardless of the type of cable used in the CSMA/CD Bus LAN, the format of the frame generated by the MAC sub-layer is the same.

– Frames are transmitted using Manchester Encoding.

– The preamble contains the pattern 10101010… (a square wave) lasting for 5.6sec. When a network card hears that pattern, it gets ready to listen to the address information.

– The Start Of Frame (SOF) byte has the pattern 10101011 (continuing the square wave until the last bit). This change indicates that the destination address follows.

Data

Bytes:

Preamble Destination address

Source address

Data Length

Pad Checksum

0-15007 1 2 or 6 2 or 6 2 0-46 4

SOF Delimiter

Page 14: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/14/96

AST P275

Page 15: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/15/96

IEEE 802.3: MAC Addresses

• Every network card in the world has a unique 46-bit serial number called a MAC address. The IEEE allocates these numbers to network card manufacturers who encode them into the firmware of their cards.– The destination and source address fields of the MAC

frame have 48 bits set aside (the standard also allows for 16-bit addresses but these are rarely used).

– The most significant bit is set to 0 to indicate an ordinary address and 1 to indicate a group address (this is for multicasting, which means that frames are sent to several hosts). If all 48 bits are set to 1 then frames are broadcast to all the hosts.

– If the two most significant bits are both zero then the 46 least significant bits contain the MAC addresses of the source and destination hosts.

Page 16: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/16/96

IEEE 802.3: The Other Frame Fields

• The data length field contains the number of bytes of data (up to a maximum of 1500 bytes).

• The data field contains the LLC data structure, which in turn contains the Network Layer packet.

• If the data field is less that an appropriate minimum length (usually 46 bytes but this can be changed if necessary) then the pad field is filled will extra bytes to ensure the frame is long enough.

• The checksum field (a 32-bit cyclic redundancy code) is tagged onto the end of the frame so that the receiving host can check it for errors.

Data

Bytes:

Preamble Destination address

Source address

Data Length

Pad Checksum

0-15007 1 2 or 6 2 or 6 2 0-46 4SOF

Page 17: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/17/96

IEEE 802.3: Minimum Frame Length

• When a host transmits a frame, there is a small chance that a collision will occur. The first host to detect a collision transmits a 48-bit jam sequence.

• To ensure that any hosts involved with the collision realise that the jam sequence is associate with their frame, they must still be transmitting when the jam sequence arrives. This means that the frame must be of a minimum length.

• The worse case scenario is if the two hosts are at far ends of the cable. If host A’s frame is just reaching host B when it begins transmitting, host B will detect the collision first and send a jam signal back to host A.

Page 18: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/18/96

IEEE 802.3: Minimum Frame Length

• The longest time between starting to transmit a frame and receiving the first bit of a jam sequence is twice the propagation delay from one end of the cable to the other.

– This means that a frame must have enough bits to last as long as twice the propagation delay.

– The 802.3 CSMA/CD Bus LAN transmits data at the standard rate of r = 10Mbps.

– The speed of signal propagation is about v = 0.66c = 2108m/s.

A BPacket starts attim e 0 A BPacket at tim e tp-

A BCollision occursat tim e tp

Jam sequence

A BJam sequence getsback to A at 2tp

Jam sequence

(a)

(c)

(b)

(d)

Page 19: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/19/96

Example of minimum Frame Length calculation

• In order to calculate the minimum frame length, we must first work out the propagation delay from one end of the cable to the other.– Say the cable is d = 400m long.– The propagation delay time tp = dv.

In our example tp = 400 (2108) = 2 10-6 or 2sec.– The round-trip propagation delay is, of course, twice this.

Thus the round trip delay is 2tp = 4sec.– With a data rate of r = 10Mbps, each bit has duration

tb = 1/r = 1 / 10,000,000 = 0.1sec.– The number of bits we can fit into a round-trip propagation

delay is 2tp tb = 4 0.1 = 40 bits.– The minimum frame length is thus 40 bits (5 bytes). A

margin of error is usually added to this (often to make it a power of 2) so we might use 64 bits (8 bytes).

Page 20: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/20/96

IEEE 802.3: Minimum Frame Length

• In order to calculate the minimum frame length, we must first work out the propagation delay from one end of the cable to the other.

– Maximum distance is d = 2,500m long.

– The propagation delay time tp = dv. In our example tp = 2500 (2108) = 1.25 10-5s or 12.5sec.

– The round-trip propagation delay is, of course, twice this. Thus the round trip delay is 2tp = 25sec.

– Delay in repeaters 25sec thus total delay is ~ 50 sec

– With a data rate of r = 10Mbps, each bit has duration tb = 1/r = 1 / 10,000,000 = 0.1sec.

– The number of bits we can fit into a round-trip propagation delay is 50sec tb = 50 0.1 = 500 bits.

– A margin of error is added to this (to make it a power of 2) so we use 512bits (64 bytes).

Page 21: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/21/96

IEEE 802.3: Minimum Frame Length

• The standard frame length is 512 bits (64 bytes) long,).– We only have to start worrying when the LAN

reaches lengths of more than 2.5km.

• 802.3 CSMA/CD bus LANs longer than 500m are composed of multiple segments joined by in-line passive repeaters, which output on one cable the signals received on another cable.

Page 22: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/22/96

IEEE 802.3: Non-Deterministic

• The 802.3 CSMA/CD bus LAN is said to be a non-deterministic network. This means that no host is guaranteed to be able to send its frame within a reasonable time (just a good probability of doing so).– When the network is busy, the number of collisions rises

dramatically and it may become very difficult for any hosts to transmit their frames.

• A real-time computing application (such as an assembly line) will demand that data is transmitted within a specified time period.– Since the 802.3 bus LAN cannot guarantee this, its use for

real-time applications may not only be undesirable but potentially dangerous in some situations.

Page 23: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/23/96

IEEE 802.4: Token Bus LANs

• IEEE 802.4 describes the operation of the MAC layer in Token Bus LANs.

• Unlike CSMA/CD buses, token buses are designed to be deterministic in operation.

– Rather than just dealing with contention as it arises, token buses avoid contention in the first place.

– Hosts are organised into a logical ring.

– Each host joins the logical ring when it is switched on.

– A token frame is sent from host to host around the ring.

– A host can transmit its frames only when it has the token.

Communication Link

Page 24: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/24/96

IEEE 802.4: Token Bus LANs

• The IEEE 802.4 token bus was originally developed for use on assembly lines.– It can be as easily extended as a CSMA/CD bus but every

host has a regular opportunity to transmit data regardless of how busy the network is.

– It is also designed to work in environments that have a lot of electromagnetic interference such as a factory floor. All those machines and forklift trucks generate a lot of electromagnetic noise.

• The specification for the IEEE 802.4 token bus is actually quite complicated and runs to over 200 pages (so we won’t go into every detail here).

Page 25: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/25/96

IEEE 802.4: Data Transmission

• The first thing to note is that the 802.4 token bus uses frequency modulation to send bits over the shared cable.– Frequency modulated signals suffer less distortion than

square waves. Also the frequencies can be filtered to remove extraneous noise.

– The 802.4 token bus also reduces noise by using coaxial cable. As you may remember, coaxial cable has an earth outer sheaf that protects the core from a lot of interference emitted from electrical equipment.

• The signals used are not restricted to just 0s and 1s. There are three other distinct signals used to indicate things like the beginnings and ends of frames.

Page 26: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/26/96

IEEE 802.4: Frame Format

• 802.4 frames are shorter than 802.3 frames. The start and end delimiters contain the special signals that cannot be confused with ordinary data.

– The frame control field is used to specify the frame type. There are token frames, ring maintenance frames (which allow hosts to join or leave the ring) and data frames.

– The source and destination address are the same as in the 802.3 frame format. The checksum is also the same.

– The special end delimiter means that there is no need to have a field counting the number of bytes in the data field.

Data

Bytes:

Destination address

Source address

Checksum

0-81821 2 or 6 2 or 6 4

Frame Control

11

Start DelimiterPreamble

1

End Delimiter

Page 27: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/27/96

IEEE 802.5: Token Ring LANs

• IEEE 802.5 describes the MAC sub-layer operation of Token Ring LANs.– The ring is composed of a series

of unidirectional point-to-pointlinks arranged in a loop.

– Each host is connected to thering via a ring interface, eachhas a 1-bit buffer used to storeone bit of the incoming frame.

– In bypass mode, bits are copied to the output (introducing a 1-bitdelay).

– In insert mode, bits are sentto the host and the host places its own bits on the network.

Ring interfacesHosts

Unidirectional Ring

One bit delay Ring interfaces

to/from host

Page 28: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/28/96

IEEE 802.5: Data Transmission

• The IEEE 802.5 token ring standard suggests using shielded twisted pair cables for the point-to-point links.

• Data is transmitted at a rates of 1Mbps, 4Mbps or 16Mbps depending on the quality of the network.

• Bits are encoded using Manchester encoding (i.e. using high-low and low-high combinations to represent 1 and 0 respectively). – The low-low and high-high combinations, which do not

normally appear in Manchester encoding, are used in special control patterns such as those used to mark the start and ends of frames.

Page 29: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/29/96

IEEE 802.5: Avoiding Contention

• Contention is avoided because only one host (the host holding the token) is allowed to transmit at a time.

• The token is a special 24-bit long frame that goes around the network when no hosts are transmitting.

– This implies that the network must be large enough to fit 24-bits of the token pattern.

– If the network is not big enough, then an elected host called the monitor acts as an elastic buffer to ensure all 24 bits can fit on the network.

• When a host wishes to transmit data, it removes the token from the network and places its own data frame on the network.

– When it is finished, it places the token back on the network.

Page 30: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/30/96

IEEE 802.5: Frame Format

• The token ring frame format has no preamble. It does not need one because the hosts already know when to expect the next frame.

• The start and end delimiters contain the special high-high and low-low combinations, which makes them unique and easily identifiable.

Data

Bytes:

FC

Destination address

Source address

Checksum

No limit

1 2 or 6 2 or 6 4

FC Frame Control

AC

1

SD

1

SD Start DelimiterAC Access Control

ED

1

ED End Delimiter

Bytes:

ED

1

AC

1

SD

1

FS

1

FS Frame Status

Token frame:

Page 31: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/31/96

IEEE 802.5: Access Control Field

• The Access Control field contains various flags used for control. The format of this field is PPPTMRRR.T is the token bit. When this is set to 1, the current frame on

the network is a token frame. If it is set to 0 then thecurrent frame is a data frame.

Mis the monitor bit. When a frame passes the monitor host, this bit is set from 0 to 1. If a frame passes the monitor host with this bit set to 1, it is removed. This prevents frames from circulating endlessly around the network.

P are the priority bits are used to indicate the priority (0..7) of a token. If a host has priority n then it must wait until it can capture a token with priority n or less.

R are the reservation bits. A host can set the priority of the next token by placing its priority in the reservation bits of any passing frame. But it cannot reduce prior reservations.

Page 32: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/32/96

IEEE 802.5: Removing Frames

• Normally it is the responsibility of the host that sends a data frame to remove it from the network.

– Frames circulate the whole way around the network. This means that it is a broadcast network.

– When the sending host hasfinished sending, it places atoken back on the network.

– If the sending host is faultythere is a chance that a data frame may be stuck on the network.

– The monitor host ensures that this does not happen by removing any frame that goes around more than once (i.e. any frame with its M bit in the Access Control field set to 1).

Sending host

Monitor host

Page 33: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/33/96

IEEE 802.5: Fair Access

• Token rings are deterministic in operation. Even so, what is there to stop one host from hogging the network?– To prevent this from happening, there is a limited token-

holding time (normally 10msec).– A host is allowed to transmit as many frames as it likes in

this time but at the end it must give up the token.– Hosts who have high priority are allowed to put in a

reservation for the next token (by setting the R bits of a frame to their priority level).

– The next token generated will then have this priority level (stored in the P bits).

– Every time a host attempts to capture a token and fails due to low priority, its priority level is raised by 1 (until it gets to the maximum priority level of 7). When it gets to send its frame, its priority level is returned to 0.

Page 34: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/34/96

IEEE 802.5: Other Fields

• After the access control field, there are a number of other fields.

• The frame control field is used to distinguish data frames from various network management frames.– One type of frame is used to elect a new monitor host in

the event of the existing monitor host failing.

• The destination and source fields contain the MAC addresses of the two hosts.

• The data field contains the data.

• The checksum contains a 32-bit CRC.

Page 35: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/35/96

IEEE 802.5: Frame Status Field

• At the end of a data frame, there is a special field called the frame status field. This contains two bits called A and C.– Both A and C are set to 0 when the data frame is

transmitted.– A is set to 1 by the receiving host to indicate that the frame

reached it.– C is set to 1 by the receiving host to indicate that the frame

was correct (i.e. the checksum was correct).• The sending host checks A and C when the last bits of

the frame arrive back.– A=0 and C=0 means that the destination was not found– A=1 and C=0 means frame was damaged (=NAK)– A=1 and C=1 means frame was received OK (=ACK)

Page 36: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/36/96

IEEE 802.5: Benefits of Token Rings

• The main advantage of using a token ring LAN like IEEE 802.5 is that network efficiency actually increases if the network is busy.

– Individual hosts may have to wait longer to transmit data but more data is being transported by the network overall as opposed to the CSMA/CD bus which carries less data.

• Because the 802.5 Token ring is deterministic, even in a busy network, each station will periodically have the opportunity to transmit its data.

• In terms of real-time computing, the response times and throughput on a busy network are far better on a token-ring than they are on a CSMA/CD bus LAN.

Page 37: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/37/96

Page 38: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/38/96

Layers of a Protcol Architectureapplication layer process-to-process communication examples: WWW, email, teleconferencing, info. retrieval

presentation layer (OSI only) conversion of data to a common format (e.g., little endian versus big-endian byte orders, integer and floating point numbers).

Internet stack: data conversion a user-level concern

session layer (OSI only) session set up (e.g., authentication), recovery from failure (broken

session) a "thin" layer

transport layer transport service: end-to-end delivery of data may multiplex several streams

from higher layers sender/receiverspeed matching Internet: TCP and UDP

Page 39: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/39/96

Layers of a network architecture

network layer at end hosts: start packets on their way at routers: control packet routing bottleneck avoidance, congestion control Internet: IP packets

data link layer point-to-point error free communication over a single link multi-access LAN protocols speed matching between sender/receiver Logical Link Control and Medium Access Control

physical layer : stuff of EE's transmitting raw bits (0/1) over wire

Page 40: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/40/96

Internetworks - The Internet• an internet:

interconnection of many networks

• a network of networks

each network administered separately

• the Internet: each network runs same software: the Internet protocols

Page 41: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/41/96

Protocol Packets packet : unit of data exchanged between protocol

entities in a given layer

data at one layer encapsulated in protocol data unit at lower layer hence "envelope within envelope"

Page 42: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/42/96

Internet Protocol

• Internet Protocol, connectionless, unreliable • maximum size "packet“ datagram

– if data to be sent is larger than packet (typically 1.5 K)

– then the IP protocol will fragment it into pieces send each independently reassembled at the other end.

• source address, destination address • Errors cause "packet" to be discarded

– If any fragments are discarded, the entire datagram is discarded

• Flow control • if packets are discarded because they are coming too

fast– buffer overflow then IP send a "source quench"

message to the sender, it is then up to the sender to respect this

Page 43: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/43/96

IP addresses

• 32 bits, divided into classes based on the first few bits

• The idea is that knowing the class of the address enables a router to send a packet by looking at only the network id part of the address means that a network id must represent a contiguous network, i.e. they are close together

• Like telephone numbers 028 > NI

Page 44: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/44/96

Class A Network

• binary address start with 0, therefore the

decimal number can be anywhere from 1 to

126. The first 8 bits (the first octet) identify the

network and the remaining 24 bits indicate the

host within the network. An example of a Class

A IP address is 102.168.212.226, where "102"

identifies the network and "168.212.226"

identifies the host on that network.

Page 45: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/45/96

Class B Network

• binary addresses start with 10, therefore the

decimal number can be anywhere from 128 to

191. (The number 127 is reserved for loopback

and is used for internal testing on the local

machine.) The first 16 bits (the first two octets)

identify the network and the remaining 16 bits

indicate the host within the network. An

example of a Class B IP address is

168.212.226.204 where "168.212" identifies

the network and "226.204" identifies the host

on that network.

Page 46: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/46/96

Class C Network

• binary addresses start with 110, therefore the

decimal number can be anywhere from 192 to

223. The first 24 bits (the first three octets)

identify the network and the remaining 8 bits

indicate the host within the network. An

example of a Class C IP address is

200.168.212.226 where "200.168.212"

identifies the network and "226" identifies the

host on that network.

Page 47: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/47/96

Class D Network

• binary addresses start with 1110,

therefore the decimal number can be

anywhere from 224 to 239. Class D

networks are used to support

multicasting.

Page 48: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/48/96

Class E Network

• binary addresses start with 1111, therefore

the decimal number can be anywhere from

240 to 255. Class E networks are used for

experimentation. They have never been

documented or utilized in a standard way.

Page 49: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/49/96

ClassLeftmost

bitsStart

addressFinish address

A 0xxx 0.0.0.0127.255.255.25

5

B 10xx 128.0.0.0191.255.255.25

5

C 110x 192.0.0.0223.255.255.25

5

D 1110 224.0.0.0 239.255.255.25

5

E 1111 240.0.0.0 255.255.255.25

5

Page 50: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/50/96

Addressing problems

• running out of Class B address space few businesses need 65K hosts, but many need more than 254 running out of total space.

• Consider telephone digits – 8 in NI > 99,999,999

• now have "classless" routing in which the netid is of variable length

• Solution proposed is IPv6 – 128 bits of address space – 3x10^38 ie lots of IP addresses – new routing hardware – and must be backward compatible with IPv4

Page 51: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/51/96

IPv6 also enables.

• Multicast – suppose you're send out a video of the state of the

Union address from CNN.com you probably have a dozen people asking for it at once, maybe more it would be nice to send just one message rather than a separate TCP connection for everyone

– send a single stream of data in response to several requests.

– capacity built into IPv6, but not many routers handle it

Page 52: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/52/96

IPv6 also enables.

• Anycast – Suppose you're Netscape and you have

100 mirror sites for people to download Communicator you want people to go to the mirror site nearest them

– but you want to have just one URL an anycast address says take me to any address in the following set, whichever is closest in your routing table we could define download.netscape.com as an anycast address

Page 53: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/53/96

Internet Protocol

• IP provides a connection-less, unreliable service – a datagram service. – you give a packet to IP, and IP does the

best it can to deliver it to the destination. There are no guarantees, and the sender is not informed if a packet (datagram) is lost.

– If reliability is needed it is provided by acknowledgements, timers and resending in the Transport layer which is above IP.

Page 54: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/54/96

Internet Protocol

• An IP datagram is an abstraction of a frame in a physical network. – It consists of a header and a data area. IP does

not care what the data is. IP datagrams are (fragmented if necessary) encapsulated in frames when they are sent across a network.

Page 55: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/55/96

Datagram

Version Header length Type of service

Total length

Identification

Fragment offset

Time to Live Protocol

Header Checksum

Source address (32 bits)

Destination address (32 bits)

Data <= 65536 octets

16 bits

Page 56: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/56/96

IP datagram header:

• VERS - this field is the IP version of the sending IP process v4 or v6. this field ensures that all agree on how to interpret the rest of the datagram.

• HLEN - length of the header in words, i.e., 32 bit units. PADDING is used to make the total header length an even number of words. Most common header is 20 octets long and has a HLEN value of 5.

Page 57: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/57/96

IP datagram header:

• TOTAL LENGTH - total length of header and data in bytes (octets).

• SERVICE TYPE• PRECEDENCE: A priority between 0 and

7.– D - low delay desired (for voice, video, etc)– T - high throughput desired (bulk transfer)– R - high reliability desired (expensive to

retransmit?)

Page 58: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/58/96

IP datagram header

• TTL - Time To Live. This field is a limit on how long the datagram can remain in the network. It is initialized to a sufficiently large value and is then decreased by one by every router that forwards the datagram. If the TTL field ever reaches zero, the datagram is discarded, and an error message is sent to the original source.

• PROTOCOL - Specifies which Transport Layer

protocol sent the datagram. Used to pass the datagram to the correct Transport Layer protocol in final destination.

Page 59: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/59/96

IP datagram header

• HEADER CHECKSUM - Used to ensure that the *header* is correctly transmitted and that nothing bad has happened to it in malfunctioning routers. Obtained by treating the header as a sequence of 16 bit integers and adding them together with one's complement arithmetic. This is a simple checksum and the reason is that it is performed in software.

• ADDRESSes and DATA see diagram

Page 60: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/60/96

Operation

• So what happens if a datagram is to be sent across an ethernet? The maximum size of an ethernet frame is 1500 bytes, so the whole datagram cannot be sent over the ethernet!

• Most physical networks have an upper limit on the size of their frames. This is called the MTU (Maximum Transfer Unit) of the network.

Page 61: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/61/96

Datagram

Version Header length Type of service

Total length

Identification

Fragment offset

Time to Live Protocol

Header Checksum

Source address (32 bits)

Destination address (32 bits)

Data <= 65536 octets

16 bits

Page 62: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/62/96

Operation

• If the datagram is larger than the MTU of a network that IP wants to send it over, the datagram must be split into several smaller pieces. These are called *fragments*, and the splitting is called *fragmentation*.

• See Tanenbaum on the issue of fragmentation

Page 63: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/63/96

TCP/IP protocols

I P

TCP UDP

App 1 Protocol

App 2 Protocol

App 3 Protocol

App 1 App 2 App 3

Network oriented layers

Data Communications Network

IP Datagram

TCP/UDP PDU

Application PDU

IP address in IP datagram header

Protocol field in IP datagram header

Protocol port address inTCP/UDP PDU header

(Layer Protocol DataUnits .. PDUs)

(Interlayer addressselectors)

HOST

Page 64: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/64/96

TCP/UDP PDU embedded within network PDU

Application Protocol Data Unit

User Data TCP/UDP

PDU header IP header User Data

LAN WAN

PDU header

LAN WAN

trailer

Page 65: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/65/96

UDP datagram header format

IP Header

Source Port

Data

Destination Port

Length

ChecksumUDPDatagram

Header

Body

Page 66: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/66/96

TCP header format

Source Port

Data

Destination Port

HeaderLength

Checksum

Sequence Number

Acknowledgement Number

Reserved Code bits

Window

Urgent Pointer

Options if any Padding if required

Page 67: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/67/96

TCP Header description

• Source and destination ports (16 bits each)

– IP address + port define its unique Transport Service Access Point

• Sequence and Acknowledgement on a byte-wise basis

• TCP header length is required because Option field can be variable

• Code bits

– URGent pointer field valid

– ACKnowledgement field vaild

– PuSHed data, receiver serves it up to application without buffering

– ReSeT seq/ack numbers .. Crash or rejection

– SYNchronise sequence numbers

– FINal byte from sending host

Page 68: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/68/96

TCP Header description (continued)

• Window, for sliding window control scheme• Checksum on header and the data• when URG flag set

– urgent pointer indicates the amount of urgent data in segment

• Options– enables hosts to specify the maximum TCP payload

• default is 536 bytes of data + 20 header

• but on low error LAN the sender may specify larger payload

Page 69: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/69/96

TCP's properties

• maintains a connection between machines– really between processes living on ports

• data integrity (checksum) • acknowledgement • retransmit • duplicate detection • sequencing • flow control

Page 70: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/70/96

TCP transfer using IP

• A connection has to be established before transmission takes place – remember that there is no notion of connection in IP

• passive listen and accept on the server side

• active connect on the client side

• then accept on server side

• the client sends a message back saying that it is aware that the connection is in place.

• Called the 3 way handshake and is humanised below

open?

yes?

ok?

Page 71: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/71/96

TCP connection establishment

Host 1 Host 2

SYN (SEQ = x )

SYN (SEQ = y, ACK = x+1 )

SYN (SEQ = x+1, ACK = y+1 )

Page 72: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/72/96

TCP Lingo

• When a client requests a connection, it sends a “SYN” segment (a special TCP segment) to the server port.

• SYN stands for synchronize. The SYN message includes the client’s ISN.

• ISN is Initial Sequence Number.

Page 73: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/73/96

More...

• Every TCP segment includes a Sequence Number that refers to the first byte of data included in the segment.

• Every TCP segment includes a Request Number (Acknowledgement Number) that indicates the byte number of the next data that is expected to be received.– All bytes up through this number have already been

received.

Page 74: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/74/96

And more...

• There are a bunch of control flags:– URG: urgent data included.

– ACK: this segment is (among other things) an acknowledgement.

– RST: error - abort the session.

– SYN: synchronize Sequence Numbers (setup)

– FIN: polite connection termination.

Page 75: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/75/96

And more...

• MSS: Maximum segment size (A TCP option)

• Window: Every ACK includes a Window field that tells the sender how many bytes it can send before the receiver will have to toss it away (due to fixed buffer size).

Page 76: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/76/96

TCP Connection Creation

• A server accepts a connection.– Must be looking for new connections!

• A client requests a connection.– Must know where the server is!

Page 77: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/77/96

Client Starts

• A client starts by sending a SYN segment with the following information:– Client’s ISN (generated pseudo-randomly)

– Maximum Receive Window for client.

– Optionally (but usually) MSS (largest datagram accepted).

– No payload! (Only TCP headers)

Page 78: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/78/96

Sever Response

• When a waiting server sees a new connection request, the server sends back a SYN segment with:– Server’s ISN (generated pseudo-randomly)

– Request Number is Client ISN+1

– Maximum Receive Window for server.

– Optionally (but usually) MSS

– No payload! (Only TCP headers)

Page 79: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/79/96

Finally

• When the Server’s SYN is received, the client sends back an ACK with:– Request Number is Server’s ISN+1

Page 80: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/80/96

Client Server

SYNISN=X

SYNISN=X

1

SYNISN=Y ACK=X+1

SYNISN=Y ACK=X+1

2

ACK=Y+1ACK=Y+1 3

time

Page 81: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/81/96

Why 3-Way?

• Why is the third message necessary?

• HINTS: – TCP is a reliable service.

– IP delivers each TCP segment.

– IP is not reliable.

Page 82: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/82/96

TCP Data and ACK

• Once the connection is established, data can be sent.

• Each data segment includes a sequence number identifying the first byte in the segment.

• Each segment (data or empty) includes a request number indicating what data has been received.

Page 83: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/83/96

Buffering

• Keep in mind that TCP is (usually) part of the Operating System. It takes care of all these details asynchronously.

• The TCP layer doesn’t know when the application will ask for any received data.

• TCP buffers incoming data so it’s ready when we ask for it.

Page 84: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/84/96

TCP Buffers

• Both the client and server allocate buffers to hold incoming and outgoing data– The TCP layer does this.

• Both the client and server announce with every ACK how much buffer space remains (the Window field in a TCP segment).

Page 85: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/85/96

Send Buffers

• The application gives the TCP layer some data to send.

• The data is put in a send buffer, where it stays until the data is ACK’d.– it has to stay, as it might need to be sent again!

• The TCP layer won’t accept data from the application unless (or until) there is buffer space.

Page 86: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/86/96

ACKs

• A receiver doesn’t have to ACK every segment (it can ACK many segments with a single ACK segment).

• Each ACK can also contain outgoing data (piggybacking).

• If a sender doesn’t get an ACK after some time limit (MSL) it resends the data.

Page 87: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/87/96

TCP Segment Order

• Most TCP implementations will accept out-of-order segments (if there is room in the buffer).

• Once the missing segments arrive, a single ACK can be sent for the whole thing.

• Remember: IP delivers TCP segments, and IP in not reliable - IP datagrams can be lost or arrive out of order.

Page 88: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/88/96

Termination

• The TCP layer can send a RST segment that terminates a connection if something is wrong.

• Usually the application tells TCP to terminate the connection politely with a FIN segment.

Page 89: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/89/96

FIN

• Either end of the connection can initiate termination.

• A FIN is sent, which means the application is done sending data.

• The FIN is ACK’d.

• The other end must now send a FIN.

• That FIN must be ACK’d.

Page 90: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/90/96

App1 App2

FINSN=X

FINSN=X

1

ACK=X+1ACK=X+12

ACK=Y+1ACK=Y+1 4

FINSN=Y

FINSN=Y

3...

Page 91: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/91/96

TCP issues

• When a write occurs on one side of the connection, TCP breaks the message into segments, typically of MTU size sends them to the next layer for transmission one at a time if a quench command is sent, TCP delays before sending, If no acknowledgement appears, TCP resends all unacknowledged packets.

• On the other end, TCP assembles the fragments into a single message does the checksum, acknowledges receipt or asks for retransmission and detects duplicates which it then discards.

• Out of band data some information needs immediate priority transmission eg ctrl-C this data hops over everything else buffered for output.

• See Tanenbaum for good treatment of Congestion control and timer management.

Page 92: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/92/96

Applications and their port numbers

• Simple Network Management Protocol SNMP port 161• File Transfer Protocol FTP port 21• Simple Mail Transfer Protocol SMTP port 25• Telenet port 23• Gopher port 70• WWW port 80

• see RFC1700 for well known port numbers etc

Page 93: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/93/96

Distributed system • application-level concerns and semantics:

distributed file system, atomic remote actions • reliable on network communication service to

implement higher-level services

multiprocessors • processors connected by high-speed

interconnect • “finer-grained" communication than network

communication • link length limited to several meters • network/multiprocessor distinction can be

blurred: network of workstations with high-speed interconnect .

Network, distributed system, parallel computer?

Page 94: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/94/96

No. of Hosts on Internet as of Feb 06

Page 95: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/95/96

Internet growth:

Date Hosts | Date Hosts Networks Domains ----- --------- + ----- --------- -------- --------- 12/69 4 | 07/89 130,000 650 3,900 06/70 9 | 10/89 159,000 837 10/70 11 | 10/90 313,000 2,063 9,300 12/70 13 | 01/91 376,000 2,338 04/71 23 | 07/91 535,000 3,086 16,000 10/72 31 | 10/91 617,000 3,556 18,000 01/73 35 | 01/92 727,000 4,526 06/74 62 | 04/92 890,000 5,291 20,000 03/77 111 | 07/92 992,000 6,569 16,300 12/79 188 | 10/92 1,136,000 7,505 18,100 08/81 213 | 01/93 1,313,000 8,258 21,000 05/82 235 | 04/93 1,486,000 9,722 22,000 08/83 562 | 07/93 1,776,000 13,767 26,000 10/84 1,024 | 10/93 2,056,000 16,533 28,000 10/85 1,961 | 01/94 2,217,000 20,539 30,000 02/86 2,308 | 07/94 3,212,000 25,210 46,000 11/86 5,089 | 10/94 3,864,000 37,022 56,000 12/87 28,174 | 01/95 4,852,000 39,410 71,000 07/88 33,000 | 07/95 6,642,000 61,538 120,000 10/88 56,000 | 01/96 9,472,000 93,671 240,000 01/89 80,000 | 07/96 12,881,000 134,365 488,000 | 01/97 16,146,000 828,000 | 07/97 19,540,000 1,301,000

from: http://www.zakon.org/robert/internet/timeline/

Page 96: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/96/96

Note: A more accurate survey mechanism was developed in 1/98; new and some corrected numbers are shown below. For further info, see Sources section.

Date Hosts | Date Hosts | Date Hosts ----- ----------- + ----- ----------- + ----- ----------- 01/95 5,846,000 | 01/99 43,230,000 | 01/03 171,638,297 07/95 8,200,000 | 07/99 56,218,000 | 01/04 233,101,481 01/96 14,352,000 | 01/00 72,398,092 | 07/04 285,139,107 07/96 16,729,000 | 07/00 93,047,785 | 01/05 317,646,084 01/97 21,819,000 | 01/01 109,574,429 | 07/05 353,284,187 07/97 26,053,000 | 07/01 125,888,197 | 01/06 394,991,609 01/98 29,670,000 | 01/02 147,344,723 | 07/06 439,286,364 07/98 36,739,000 | 07/02 162,128,493 |

from: http://www.zakon.org/robert/internet/timeline/

Page 97: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/97/96

WWW Growth: http://www.zakon.org/robert/internet/timeline/

12/90 1 | 02/99 4,301,512 | 12/02 35,543,105 12/91 10 | 03/99 4,349,131 | 01/03 35,424,956 12/92 50 | 04/99 5,040,663 | 02/03 35,863,952 06/93 130 | 05/99 5,414,325 | 03/03 39,174,349 09/93 204 | 06/99 6,177,453 | 04/03 40,100,739 10/93 228 | 07/99 6,598,697 | 05/03 40,444,778 12/93 623 | 08/99 7,078,194 | 06/03 40,936,076 06/94 2,738 | 09/99 7,370,929 | 07/03 42,298,371 12/94 10,022 | 10/99 8,115,828 | 08/03 42,807,275 06/95 23,500 | 11/99 8,844,573 | 09/03 43,144,374... 07/98 2,594,622 | 05/02 37,574,105 | 03/06 77,568,868 08/98 2,807,588 | 06/02 38,807,788 | 04/06 80,655,992 09/98 3,156,324 | 07/02 37,235,470 | 05/06 81,565,877 10/98 3,358,969 | 08/02 35,991,815 | 06/06 85,541,228 11/98 3,518,158 | 09/02 35,756,436 | 07/06 88,166,395 12/98 3,689,227 | 10/02 35,114,328 | 08/06 92,615,362 01/99 4,062,280 | 11/02 35,686,907 | 09/06 96,854,877 | | 10/06 97,932,447 | | 11/06 101,435,253...Sites = # of web servers (one host may have multiple sites by using different domains or port numbers)... please check his site before using this data. It is under his copyright

Page 98: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/98/96

IP Nos in more depth

Page 99: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/99/96

ClassLeftmost

bitsStart

addressFinish address

A 0xxx 0.0.0.0127.255.255.25

5

B 10xx 128.0.0.0191.255.255.25

5

C 110x 192.0.0.0223.255.255.25

5

D 1110 224.0.0.0 239.255.255.25

5

E 1111 240.0.0.0 255.255.255.25

5

Page 100: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/100/96

Page 101: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/101/96

TCP/IP on my machine

Page 102: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/102/96

My IP no 193.61.148.83

• What can we determine about it?– Since it is in the range 192.0.0.0 to 223.255.255.255– It must be a class C address

• Where 1st 3 bits identify that it is class C

• Next 21 bits identify network ( one of 2 millionish)

• Last 8 bits host within network.

Page 103: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/103/96

http://www.ripe.net/index.html

Page 104: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/104/96

Page 105: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/105/96

Page 106: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/106/96

Page 107: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/107/96

Page 108: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/108/96

193.61.128.00 /14

193.61.159.255 range for UUJ

1100 0000 | 0011 1101 | 1000 0000 | 0000 0000 = 193.61.128.0

1100 0000 | 0011 1101 | 1001 1111 | 1111 1111 = 193.61.159.255

(159-128)*256 = 7936 addresses

193.61.160.00 /14193.61.175.255 range for UUC

1100 0000 | 0011 1101 | 1010 0000 | 0000 0000 = 193.61.160.0

1100 0000 | 0011 1101 | 1010 1111 | 1111 1111 = 193.61.175.255

(175-160)*256 = 3840 addresses

Page 109: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/109/96

1111 1111 | 1111 1100 | 0000 0000 | 0000 0000 = 255.252.0.0 mask (aggregate entry in CIDR) sometimes depicted as \14 since the first 14 bits are set to 1.

1100 0000 | 0011 1101 | 1001 0100 | 0101 0011 = 193.61.148.831111 1111 | 1111 1100 | 0000 0000 | 0000 0000 = 255.252.0.01100 0000 | 0011 1100 | 0000 0000 | 0000 0000 = 193.60.0.0 it’s a match!

The first fourteen bits must be identical to those in red in order that an IP address be routed in this direction.

Hence UUJ has

From:1100 0000 | 0011 1101 | 1000 0000 | 0000 0000 = 193.61.128.0

To:1100 0000 | 0011 1101 | 1001 1111 | 1111 1111 = 193.61.159.255

Page 110: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/110/96

Talking across LANs

• Consider that I, on 193.61.148.83 with subnet mask

255.255.255.0, wish to talk to Mary on 193.61.149.46.

• Since my subnet mask defines that all with addresses

193.61.148.0 to 193.61.148.255 as local

• this packet to 193.61.149.46 will be passed to a router

(gateway) on 193.61.148.200

Page 111: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/111/96

Note the route has two NICs one for each network

Router

Me Mary

193.61.148.00/24 193.61.149.00/24

Packet

Page 112: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/112/96

My IP address193.61.148.83

Mary’s IP address193.61.149.46

My MAC address

Router’s lhs MAC address

IP

MAC

Source Destination

First step forward to route and stored there

Page 113: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/113/96

Router

Me Mary

193.61.148.00/24 193.61.149.00/24Packet

Packet in router and passed up to IP layer

Page 114: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/114/96

My IP address193.61.148.83

Mary’s IP address193.61.149.46

Mary’s MAC address

IP

MAC

Source Destination

Second step rebuild packet and forward to Mary

Router’s rhs MAC address

Page 115: Www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/1/96 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

www.eej.ulster.ac.uk/~ian/modules/COM347J1/COM347J1_L7.ppt L7/115/96

Router

Me Mary

193.61.148.00/24 193.61.149.00/24

Packet

Packet passed to Mary