+ All Categories
Home > Documents > Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show...

Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show...

Date post: 08-Aug-2020
Category:
Upload: others
View: 12 times
Download: 1 times
Share this document with a friend
117
Exercises on Computer Networks and Networking Version 2.00 April 2005
Transcript
Page 1: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Exercises on Computer Networksand Networking

Version 2.00April 2005

Page 2: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

2

Page 3: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Contents

1 Network Principles 51.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Network Protocols 92.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Network Signal Transmission: Physical Layer 133.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 Network Transmission Standards: Data Link Layer 174.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5 Network Protocols: Network Layer 255.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

6 Network Design 296.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

7 Network Analysis 357.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

8 Network Management and Monitoring 418.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

9 Network Security 459.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

A Solutions 47A.1 Solutions to exercises: Section 1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 47A.2 Solutions to exercises: Section 2.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 54A.3 Solutions to exercises: Section 3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 62A.4 Solutions to exercises: Section 4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 67A.5 Solutions to exercises: Section 5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 83A.6 Solutions to exercises: Section 6.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 89A.7 Solutions to exercises: Section 7.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 96A.8 Solutions to exercises: Section 8.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 111A.9 Solutions to exercises: Section 9.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

3

Page 4: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

4 CONTENTS

Page 5: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Chapter 1

Network Principles

1.1 Exercises1. Research the HTTP protocol.

(a) What is it used for?(b) What does the acronym stand for.(c) Does it operate in client-server or peer-to-peer setting?(d) Imagine that you are using HTTP to provide a service for a large company. What

network topology would be best suited to providing this service, and why?(e) Describe a typical session between two machines running this protocol.(f) Telnet to port 80 on a local machine providing HTTP service, and issue a simple

request. What is the response, and how should it be interpreted?

2. Consider an application to draw images of fractals. The structure of the program is asfollows:

For all the points on the screenCalculate the colour of that point in the fractal.Draw a point of that colour in the appropriate position.

(a) What is a fractal?(b) Suggest modifications to this program that would allow it to use a network to share

the computing load amongst a number of computers, but only display on a singlestation.

(c) Suggest modifications to this program that would allow it to use a network todisplay on multiple stations without recomputing the colours for each station.

3. Describe the types of networks:

(a) LAN(b) MAN(c) WAN

4. Trace the development of networking technology over the past ten years. What newcapabilities do you predict for the next five years?

5. Why is it becoming more difficult to distinguish between LANs, MANs, and WANs?Will there continue to be a need for the term LAN?

5

Page 6: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

6 CHAPTER 1. NETWORK PRINCIPLES

6. How many terminators are used in a ring topology?

7. Which media access method provides the best security? Why?

8. What are three methods used for multiplexing? Which method works best for high-speed data transmissions?

9. What are the advantages to using twisted-pair instead of coax cable?

10. Design a simple E-commerce application. Your application should consist of at leasttwo classes: Customer and Shop. Customer will request a list of the items in the shop,together with the price of each item. It will then choose a selection of these items, andinteract with the Shop to purchase them. This will continue until the Customers runout of money, or the Shop runs out of products. List the methods through which theCustomer and Shop will interact, and specify the sequence in which these methods arecalled.

11. Suggest ways in which an E-commerce application could maintain a shopping cart.

12. An E-commerce application relies on money changing hands when products are bought.Suggest a network architecture that support secure and efficient transfer of funds be-tween a Bank, Customer and Shop. Explain the order and type of communication be-tween these entities.

13. A HTTP proxy requests information from web servers on behalf of clients.

(a) Suggest some potential applications for such a proxy.(b) How could a proxy be employed in a peer-to-peer environment? What network

topology would be best in this situation?(c) How could a single proxy be employed in a client-server environment? What net-

work topology would be best in this situation?(d) How could multiple proxies be employed in a client-server environment? What

network topology would be best in this situation?

14. Explain the difference between circuit switching, packet switching and virtual circuits.

15. Wireless networks change many of the restrictions associated with cable based net-works. For each of the following topics, find out how they apply to a wireless network(for the wireless network of your choice):

(a) Network size(b) Topology(c) Multiplexing technique

16. Describe the topology, multiplexing and switching mechanisms of the following net-works:

(a) The national road network.(b) The entire road network in the country.(c) Railway network.(d) (Oral) Communication network within a company.(e) Network of aisles in the local supermarket.

17. List advantages of using a circuit switched network.

Page 7: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

1.1. EXERCISES 7

18. List advantages of using a packet switched network.

19. Suppose three source machines each want to communicate with one of three destinationmachines respectively. What topologies could be used for a circuit switched network?How would this differ for a packet switched network?

20. Suppose three source machines each want to communicate with one destination ma-chine (such as a file server, for example). What topologies could be used for a circuitswitched network? How would this differ for a packet switched network?

21. Compare circuit switching and packet switching in terms of:

(a) Reliability(b) Sequencing (ordering of data)(c) Speed(d) Cost

22. What is the topology of the telephone network?

23. What would the IEEE 802 cable specification be for the cable connected to a (land-line)telephone.

24. How can you tell what route your phone call takes?

25. How can you tell when packets arrive out of order on a packet switching network?

26. How are signals transmitted over a fiber optic network?

27. What is bandwidth?

28. Suggest an alternative strategy for multiplexing, excluding those based on time divisionmultiplexing.

29. What topologies (logical and physical) are employed by:

(a) The portion of the telephone network contained within a city?(b) The portion of the telephone network between cities?(c) The cell-phone network within a city?

30. How can data be transmitted over a computer network without setting up a circuitbeforehand?

31. Set a challenging question covering material from this chapter and answer it, providingfurther insight into the issue than is already covered by these notes.

Page 8: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

8 CHAPTER 1. NETWORK PRINCIPLES

Page 9: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Chapter 2

Network Protocols

2.1 Exercises1. Show the HTTP protocol, as used on the local network, in relation to the OSI model.

Describe the services provided by the protocol which match the functionality expectedat each level.

2. Research HTML.

(a) What is HTML and how does it compare to HTTP.(b) Create a web page, containing:

i. Title.ii. Heading.

iii. List of items.and preview it under your favourite browser.

3. Explain how the OSI model specifies fail-safe techniques to ensure data arrive at theirdestination accurately.

4. Why is a layered network architecture an advantage?

5. What is a peer protocol? Why is it important?

6. Under what circumstances would you install a multi-port repeater?

7. Describe how a bridge might be used to reduce network traffic problems.

8. Describe a network scenario where you would replace an existing bridge with a router.When would you employ a multimedia router?

9. Which flow control approach is more efficient? Illustrate your answer.

10. A simple client-server application consists of a client which requests sequences of neven or odd numbers, and a server which provides them. Design a suitable protocolfor this application, in particular specifying the format of the headers involved in theprotocol.

11. Design a protocol to provide a reliable stream of data and be implemented on top of aprotocol which provides an unreliable, packet based service. Show the header required,and explain how each field will be used to achieve the required service.

12. Identify the communication issues addressed by protocols at each level of the OSImodel.

9

Page 10: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

10 CHAPTER 2. NETWORK PROTOCOLS

13. List the messages exchanged by the HTTP protocol during the retrieval of a web pagefrom a server by a web client.

14. Describe how the HTTP/TCP/IP/Ethernet protocol deals with the following communi-cation issues: Reliability, Sequencing, Lost Packets, Duplicate Packets, Flow control,Addressing, Connection Establishment, Connection Termination.

15. Suppose a proxy server is introduced into the HTTP client-server scenario. List themessages that need to be exchanged between the various components to retrieve a webpage.

16. For each of the following:

• Identify the communication issue that it addresses.• Explain briefly how it works.• Identify the associated layer of the OSI model.• Name a protocol that uses it.

(a) Cyclic Redundancy Code.(b) Sliding Window.(c) Port Numbers.(d) 3-way handshake.(e) Sequence numbering.

17. Explain 3 ways in which the OSI model specifies fail-safe techniques to ensure dataarrive at their destination accurately.

18. Switching and routing can occur at various layers. How is this possible, given that theintent of a layered model is to restrict specific functions to a single layer?

19. Suggest novel strategies for dealing with each of the following communication issues:

(a) flow control(b) lost packets(c) duplicate packets

20. Suppose a picture containing 1000 lines, each containing 1000 pixels is transmittedover a 100Mbps network link.

(a) What is the shortest time required?(b) What factors will determine how closely we can reach this target time?

21. Match each of the communication issues, protocols and OSI layers:

• Error correction, sequencing, connection creation, flow control, retransmitting lostpackets, data formatting and presentation.

• Ethernet, TCP, UDP, HTTP, 100BaseT.• Application, Presentation, Session, Transport, Network, Data Link, Physical.

22. A four layer network model is given 20 octets to send. Each layer adds a 5 byte header.Sketch the way in which information is passed from one layer to the next.

23. Which issues must be resolved to make a packet switched network appear as a circuitswitched network (i.e. to provide virtual circuits)?

Page 11: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

2.1. EXERCISES 11

24. What advantages can be gained from using virtual circuits over a packet switched net-work, as opposed to a physical circuit switched network.

25. How does the Post Office address the following communication protocol issues:

(a) error detection(b) lost packets (letters)(c) flow control(d) addressing

26. What relationship must exist between protocol stacks on the sending and receivingmachines?

27. Suppose you invent an innovative new technique for detecting lost packets. How muchof the protocol stack needs to change to support this improvement?

28. Which communication issues would a protocol used for transferring e-mail have to ad-dress?

29. At what level of the OSI model would you expect to find a protocol for transferringe-mail?

30. Why must issues of addressing be addressed at each of the Data Link, Network andTransport layers?

31. In a client-server environment, how would the clients find the server?

32. In a peer-to-peer environment, how would the peers become aware of each other?

33. Why are routers used in the Internet, rather than bridges.

34. Latency refers to the time taken between the time at which a packet is sent, and thetime at which it is received. Rank network devices according to the influence they haveon latency.

35. How can you detect if a checksum has been corrupted?

36. Why not have all virtual circuits start numbering sequences at 0?

37. Suggest an alternative approach to dealing with lost packets?

38. An alternative flow control approach has the receiver send “Slow Down” messages tothe sender. How feasible is this approach?

39. What would be a good software engineering approach to implementing a protocol thatcontains strategies to deal with all the communication issues?

40. Why bother to standardize on a layering system such as the OSI model, if a popularprotocol such as TCP doesn’t bother to conform to it?

41. Suppose one wants to transmit datagrams (discrete packets) on the network. Is thisstill possible with a layer that takes care of streaming?

42. What sort of information would be included along with the data by each level of aprotocol stack?

43. Is it a good idea to standardize on something like the ISO’s OSI model?

44. Is a layered approach a good idea for network software design?

Page 12: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

12 CHAPTER 2. NETWORK PROTOCOLS

45. Does TCP support broadcast?

46. A well known protocol uses a 2-byte field to represent the size of the packet. What isthe maximum packet size that can be supported by this protocol?

47. What methods could be used to find the address of a server to which we want to estab-lish a connection?

48. Set a challenging question covering material from this chapter and answer it, providingfurther insight into the issue than is already covered by these notes.

Page 13: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Chapter 3

Network Signal Transmission:Physical Layer

3.1 Exercises1. Encode the following sequences of bits

• 111110000• 101011010

using:

(a) NRZ(b) Unipolar RZ(c) Polar RZ(d) Manchester Encoding

2. Divide the following bit stream into frames, assuming that it is using the HDLC flagfor framing:00101100110111111011011011111011000111111000111110011011111101111

3. Calculate the following checksums on the data: 9 13, each represented as 4 bit binarynumbers.

(a) Sum of values, modulus 8.(b) Remainder, after division by binary value 101.

Which of these detect an error if the values 8 14 reach the destination?

4. Encode the following sequences of bits

• 00011100• 10100011

using:

(a) NRZ(b) Unipolar RZ(c) Polar RZ

13

Page 14: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

14 CHAPTER 3. NETWORK SIGNAL TRANSMISSION: PHYSICAL LAYER

a)

b)

c)

Figure 3.1: Signalling 11110000.

(d) Manchester Encoding

5. Divide the following character stream into frames. Each character is represent by aone/two/three letter code.DLE SOH NAK SYN DLE DLE SOH DLE STX FF NP M E S S A G E CAN ETB DLEETX DLE SOH BEL DLE STX H E L L O EM DLE ETX

6. Calculate the following checksums on the data: 3 8 7 5, each represented as 4 bit binarynumbers.

(a) Sum of values, modulus 8.(b) Remainder, after division by binary value 101.

Which of these detect an error if the values 4 8 8 5 reach the destination?

7. Encode the following sequences of bits

• 00110110• 10101111

using:

(a) NRZ(b) Unipolar RZ(c) Polar RZ(d) Manchester Encoding

8. Figure 3.1 shows a number of signals encoding the bit sequence 11110000. Identify thesignalling technique used in each case.

9. Decode the following signals shown in Figure 3.2.

10. Encode the sequence 11001100 using Manchester encoding.

Page 15: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

3.1. EXERCISES 15

Figure 3.2: Signals.

11. Break the following sequence into frames:X A T H E X B F O X X A N D X A A X B H O U N Dwhere X = DLE, A = SOH, B = SOT.

12. How many bits in a byte?

13. How fast does data travel on the network (and how long is a bit when transmitting at100Mbps)?

14. How many bits can be in transit on a 100m piece of 100BaseT at any time?

15. Encode the following bit sequence 11100011 using:

(a) NRZ(b) Polar RZ(c) Manchester encoding

16. In how many ways can the following Manchester encoded sequence be interpreted?

17. Frame the following message: 41 10 10 45 01 44 03, with header 64 65 66 where:

• DLE=10• SOH=01• STX=02• ETX=03

18. Why would one use more than 1 stop bit to resynchronize clocks using asynchronoustransmission?

19. How can we detect when the network is idle?

20. Is it possible to have synchronized clocks, or timers, on two separate computers?

21. What effect would having 4 voltage levels to signal bits (instead of 2) have on the sig-naling process?

Page 16: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

16 CHAPTER 3. NETWORK SIGNAL TRANSMISSION: PHYSICAL LAYER

22. What sequence of bits could the following signal decode to?

respect to the signalling method.Scale is for covenience and has no significance with

23. The data-link protocol ISDN using a signaling method called 2B1Q, where voltage isset according to the following table. Encode the bit sequence 1011011011 using 2B1Q.

Bit Pattern Voltage00 -2.501 -0.83310 +2.511 +0.833

24. A CRC treats the message as a long binary number which it divides by another anduses the remainder as the CRC. Based on this, what change to the message will it failto detect?

25. Divide 110112 by 1012.

26. At what layer of the OSI model could the use of a CRC be expected?

27. Set a challenging question covering material from this chapter and answer it, providingfurther insight into the issue than is already covered by these notes.

Page 17: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Chapter 4

Network TransmissionStandards: Data Link Layer

4.1 Exercises1. Calculate the theoretical maximum distance for Ethernet, assuming the standard val-

ues of:

(a) Speed of light in coaxial cable = 2× 108 m/s.(b) Round trip time of 50 µs.

How does the value calculated compare with the maximum distance that can be achievedwith the original Ethernet medium.

2. Calculate the minimum packet size and maximum cable distance if the round trip timechanged to 1µs.

3. Let us define a new type of Ethernet. We will call it “RHODES” ETHERNET, justcommemorate the site of its invention. RHODES ETHERNET will have its parameterstweaked so as to give us something that is easy to diagram.Properties of RHODES ETHERNET: (show workings)

• The speed of light is still 3× 108 m/s.1

• The transmission speed will be 30Mbps.• The time spent transmitting 1 bit is then ________.• The distance on the wire occupied by 1 bit is then ______.• The maximum round trip time is 400ns = 4× 10−7 seconds.• The maximum length of cable is then ________.• The minimum packet size is then _______.

We will examine some potential situations that may occur (Let T be the time intervalrequired to transmit 1 bit). Diagram the situations as they occur, using the templatesprovided. Label each diagram with the time to which is corresponds, and show the stateof the Carrier Sense and Collision Detection at each of points A, B and C. Fill in theboxes, with the value of the bit (or a * if there is a collision), and the identifier of thestation transmitting the bit.

1Note: This is the speed of light in a vacuum. In a coaxial cable, the speed of light is closer to 2 × 108m/s

17

Page 18: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

18 CHAPTER 4. NETWORK TRANSMISSION STANDARDS: DATA LINK LAYER

(a) Transmit the following sequence of bits: 1,0,0,1 from station B to station C. Showthe state of the wire after successive intervals of T.

t=0:

A B C

Bits onthe wire10m

60m

t=T:

A B C

Bits onthe wire10m

60m

t=2T:

A B C

Bits onthe wire10m

60m

...(b) Consider the two cases of A and C transmitting simultaneously. The back-off times

for A are: 2T, 7T and 17T, those for C are 1T, 3T and 13T. Assume in this case, thatattempting to transmit in the presence of a Collision Detect signal will trigger thenext level of back-off.

i. They each transmit two bits. A transmits 1, 1. C transmits 0, 1. (belowminimum packet size)

ii. They transmit 12 bits, the minimum packet size. A transmits 1, 0, 1, 0, 1, 0, 1,0, 1, 0, 1, 0. C transmits 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0.

4. Interpret the following Ethernet frames. Identify the source and destination machines,and the type of data encapsulated in the packet.

Received a packet, with length 60FF FF FF FF FF FF 00 00 C0 FB 59 DC 81 37 FF FF00 28 00 01 00 00 01 76 FF FF FF FF FF FF 04 5300 00 01 76 00 00 C0 FB 59 DC 04 53 00 02 CC 1760 70 00 01 00 02 00 00 00 00 00 00Received a packet, with length 60FF FF FF FF FF FF 00 E0 29 18 AC 51 00 25 E0 E003 FF FF 00 22 00 11 00 00 00 00 FF FF FF FF FFFF 04 52 00 00 00 00 00 E0 29 18 AC 51 40 10 0003 00 04 20 20 20 20 20 20 20 20 20Received a packet, with length 10001 00 81 00 01 00 00 00 81 2A AB E6 00 13 AA AA03 00 00 81 01 A2 92 E7 10 17 04 ED BB 18 01 0200 00 00 00 00 00 00 00 00 00 .. 00 00 00

The following information is available:Entries from the BOOTP tables:

warthog: ha=0000c0fb59dc: tc=.subnet176: ip=146.231.176.71:ed205.educ: ha=00e02918ac51: tc=.subnet176: ip=146.231.182.22:

DIX Types

0800 DOD Internet Protocol (IP)8137 Novell (old) NetWare IPX

SAP Types

E0 Novell IPX

Page 19: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

4.1. EXERCISES 19

OUIs

000081 Synoptics0000C0 Western Digital now SMC (Std. Microsystems Corp.)00E029 SMC EtherPower II 10/100

Multicast type

01-00-81-00-01-00 (snap type 01A2) Bay Networks(Synoptics) autodiscovery

5. Why are problems on an Ethernet network difficult to trace?

6. Assume we decided to discard the current Ethernet specification for “Starlan” whichruns at 1Mbps. How would this affect:

(a) Round trip time.(b) Minimum packet size.(c) Maximum length of cable.

7. Two stations on standard 10Mbps Ethernet are 200m apart. Both transmit 64 bytes,station A starting at time 0s, and station B starting at time 0.5 microseconds. Assumethe signal propagates at 2× 108m/s.

(a) When and where do the packets collide.(b) How many bits has station A sent before it detects the collision.(c) How many bits has station B sent before it detects the collision.(d) Which station is likely to begin retransmitting first.

8. Compare the access methods that use CSMA/CD to those that use token passing. Whatare the advantages and disadvantages of each?

9. What are the advantages and disadvantages of token-ring networking?

10. Compare the response of token ring and FDDI to:

(a) An attached station being run over by a bulldozer.(b) A back-hoe amputating the cable running to an attached station.

11. Interpret the following Ethernet frames. Identify the source and destination address,and the field containing type/length of data encapsulated in the packet.

Received a packet, with length 230:FF FF FF FF FF FF 00 E0 29 0F EC AD 08 00 45 0000 D8 42 32 00 00 80 11 99 4D 92 E7 18 C8 92 E71F FF 00 8A 00 8A 00 C4 FF 70 11 02 89 80 92 E718 C8 00 8A 00 AE 00 00 20 45 49 45 42 45 4F 45Received a packet, with length 180:03 00 00 00 00 01 00 00 C0 C3 ED D2 00 A6 F0 F003 2C 00 FF EF 08 00 00 00 00 00 00 00 43 53 2020 20 20 20 20 20 20 20 20 20 20 20 1D 4C 59 5349 54 48 45 41 20 20 20 20 20 20 20 20 FF 53 4DReceived a packet, with length 94:FF FF FF FF FF FF 00 E0 29 44 21 1B 81 37 FF FF00 50 00 14 00 00 00 00 FF FF FF FF FF FF 04 5500 00 00 24 00 E0 29 44 21 1B 04 55 00 01 00 00

Page 20: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

20 CHAPTER 4. NETWORK TRANSMISSION STANDARDS: DATA LINK LAYER

12. What effect will the introduction of 100Mbps and 1Gbps transmission have on the limitsof Ethernet cable length, and packet size?

13. Identify the Ethernet frame type (the type of Ethernet header) being used by the fol-lowing packets (assume these are Ethernet packets with preamble already removed).Show any workings.

(a) Packet 1: 00 E0 29 47 89 33 00 00 C0 54 9E B8 08 00 45 00 03 4E 0E C5(b) Packet 2: 00 E0 29 0F EC AD 00 00 C0 BE 74 A7 81 37 FF FF 00 30 00 04 00(c) Packet 3: 01 80 C2 00 00 00 00 E0 1E E0 BF 00 00 26 42 42 03 00 00 00 00 00 80

00 00 00

14. Explain the conditions under which a Late Collision would occur on an Ethernet net-work.

15. Explain the acronym: CSMA/CD, and describe how Ethernet controls access to theshared medium when stations transmit a packet (a state transition diagram can beused for the latter part of this question).

16. Complete the following table, comparing the characteristics of Ethernet, Token Ringand FDDI:

Logical Topology Physical Topology LAN/MAN/WAN Multiplexing strategyEthernet

Token RingFDDI

17. Gigabit Ethernet uses the same maximum and minimum frame sizes as 10Mbps Eth-ernet. It runs on category 5 cable rated up to 125Mbps, previously used for 100MbpsEthernet. Explain how it achieves these feats without breaking the CSMA/CD protocol,or any physical laws.

18. Which node on an Ethernet network controls access to the transmission medium?

19. Can data be lost on an Ethernet network, and if so, under what conditions?

20. An Ethernet network experiences a collision. Is the network faulty?

21. What happens if the network cable is unplugged from the machine while transmitting?

22. What is the maximum distance between two points on a single Ethernet collision do-main, using 10Base5?

23. Suppose the specified round trip time for Ethernet was doubled. What effect would thathave on minimum packet size and network diameter?

24. Suppose we use 100Mbps Ethernet. How would that affect minimum packet size andnetwork diameter?

25. Suppose machines A and B are 1 m apart, and on the same (repeated) segment asmachine C, which is 10km away. A sends a 64 byte packet to B. Just before the packetreaches C, C starts transmitting.

(a) Does B receive the packet from A?(b) Does C receive the packet from A?(c) Does A retransmit the packet?

Page 21: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

4.1. EXERCISES 21

26. Suggest potential points of failure for:

(a) An Ethernet network(b) A Token Ring network.

27. What would be the equivalent of a switch on a Token Ring network?

28. Can a Token Ring network support broadcasting?

29. In which ways would FDDI be a better LAN backbone technology than Gigabit Ether-net?

30. Does ISDN use circuit switching or packet switching?

31. Category 5 twisted pair cable can transmit 100Mbps over 100m before signal attenua-tion becomes a problem. What rate do you think would be possible with Telkom’s coppertelephone cable (running over about 5km)?

32. What is better:

(a) fixed size packets or variable sized packets?(b) big packets or small packets?(c) sending each packet the same way, or routing each packet down the least congested

link?

33. What is the percentage header overhead for:

(a) An ATM cell(b) A TCP/IP/Ethernet packet with a payload of 10 bytes.(c) A UDP/IP/Ethernet packet with a payload of 1400 bytes.

34. How long would it take to transmit an ATM cell on a 622 Mbps network?

35. How long would the same cell take to travel from Cape Town to New York (~70000kmvia satellite)?

36. How many cells are in transit at any time?

37. What mechanism does Ethernet use for:

(a) Signalling (NRZ, RZ, Manchester).(b) Error correction.

38. If two stations start transmitting at opposite ends of the network at the same time,what happens to the number of bits they can transmit before collision is detected if:

(a) Cable length increases.(b) Transmission rate increases.

39. Under what circumstances will data be lost on an Ethernet network.

40. An Ethernet node successfully transmits a packet. Does Ethernet guarantee that it willbe received correctly?

41. Does Ethernet and CSMA/CD address flow control issues? What happens to an Ether-net network as the number of machines wanting to transmit increases?

Page 22: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

22 CHAPTER 4. NETWORK TRANSMISSION STANDARDS: DATA LINK LAYER

42. Suppose we keep the 50µs round trip time for 100Mbps, 1Gbps and 10Gbps Ethernet.What are the implications in terms of minimum packet size and network diameter?

43. Here are some Ethernet addresses. What can we tell about the quality of the equip-ment?

• 00:04:DC:5C:1E:01 (00:04:DC = Nortel)• 01:00:81:00:01:00 (Bay Networks Autodiscovery)• 00:00:C0:AB:23:24 (00:00:C0 = Western Digital)• 00:E0:29:47:89:E3 (00:E0:29 = SMC)

44. A router can add a significant delay to an Ethernet packet. Does this affect the calcu-lation of network size, based on round trip time restrictions?

45. Both IP and IPX (and other protocols) can be encapsulated inside an Ethernet packet.How does the receiver of an Ethernet packet know which protocol to pass the payloadto, while de-encapsulating the packet?

46. What happens to CSMA/CD in a switched environment?

47. Why did Novell have to lose the checksum field in their Ethernet header?

48. Ethernet chooses to keep the minimum packet size fixed for each rate variant. Whatdoes this imply for 1Gbps Ethernet in terms of network limits.

49. Why does a cable break on a physical bus Ethernet bring down the entire network?Why is this not the case for a physical star Ethernet?

50. Which Ethernet topologies support broadcast?

51. Which Ethernet topologies support unicast (and how)?

52. What effect would increasing the transmission rate from 10Mbps to 100Mbps haveon the length of a bit on the wire? How would that affect the Ethernet transmissionprocess?

53. Can Ethernet guarantee the safe arrival of a packet (and how)?

54. What other physical topologies may be suitable for an Ethernet network?

55. Does Ethernet provide a flow-control mechanism? Justify your answer.

56. How can 10Mbps Ethernet networks be extended beyond the 5km limit?

57. Ethernet packets have a maximum size of 1518 bytes. What factor determines thislimit?

58. How does an Ethernet station find its own Ethernet address?

59. The fields in an Ethernet header all occupy a pre-defined number of bytes. Do all fieldsin a protocol header have to have a fixed, pre-defined size?

60. 100Mbps Ethernet avoided making the minimum packet size larger for a specific rea-son. 1Gbps Ethernet did effectively end up increasing the minimum packet size. Doesthis reason no longer apply in this case?

61. Why would error detection mechanisms be included in protocols at layer 3 and up?

62. How would you find the address of another station on an Ethernet?

Page 23: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

4.1. EXERCISES 23

63. What types of error condition could you expect to find on an Ethernet network?

64. There is a version of FDDI which can use copper cables: CDDI. What are the relativemerits of the two alternatives?

65. Why would a 100Mbps FDDI network still be appropriate for a LAN backbone, whenGigabit Ethernet is available?

66. Can you run TCP/IP on a Token Ring network?

67. Suppose only one machine on a Token Ring network has messages to send. How longmust it wait for the token between messages on a network with a 100m circumference?

68. Why are traffic patterns for Token Ring easier to model than those for Ethernet.

69. How can a Token Ring network test for the presence of another station on the networkwith the same MAC address?

70. What devices can be used to connect different networks?

71. How can the performance of an Ethernet network be improved?

72. Set a challenging question covering material from this chapter and answer it, providingfurther insight into the issue than is already covered by these notes.

Page 24: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

24 CHAPTER 4. NETWORK TRANSMISSION STANDARDS: DATA LINK LAYER

Page 25: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Chapter 5

Network Protocols: NetworkLayer

5.1 Exercises1. High level protocols: Consider the following packet. Identify the key features of the

various protocols encapsulated within the packet.Received a packet, with length 127:

00 00 C0 7E A3 B600 00 C0 B9 ED D208 0045 10 00 712C 00 40 0040 06 B4 FE92 E7 1A 8792 E7 19 2300 17 28 4B1D 1E 6A 4A33 96 9F B250 18 7F E00A 9D 00 0046 6F 75 6E 64 20 6E 65 74 77 6F 72 6B 2064 65 76 69 63 65 3A 20 65 74 68 30 0D 0A52 65 63 65 69 76 65 64 20 61 20 70 61 636B 65 74 2C 20 77 69 74 68 20 6C 65 6E 6774 68 20 33 37 34 2C 20 67 6F 74 20 33 3734 0D 0A

Additional Information:Entries from the bootp tables:

snert.cs: 0000c07ea3b6, IP 146.231.25.35monza.cs: 0000c0b9edd2, IP 146.231.26.135

DIX Types

0800 DOD Internet Protocol (IP)

TCP Ports

25

Page 26: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

26 CHAPTER 5. NETWORK PROTOCOLS: NETWORK LAYER

23 Telnet

ASCII Codes

46=F, 6F=o, 75=u, 6E=n,64=d, 20=space, 65=e, 74=t, 77=w,6F=o, 72=r, 6B=k

2. HTTP uses TCP as its transport layer. Why?

3. Consider a client-server fractal computing and rendering system, running over Ether-net. You have a choice of using UDP or TCP as the transport layer. Performance is anissue. Which protocol would you choose, and why?

4. Suppose one wanted to run TCP over UDP over IP. What changes would you make tothese protocols, and how would that affect the structure of the headers?

5. Explain how TCP/IP communications work. Why has this protocol been important tothe Internet?

6. Why are port numbers used in UDP and TCP. What is the significance of the variousvalues used as port numbers.

7. What is the format of a URL to a web server which is not using the default port address?

8. Why are octet arrays used to specify TCP and UDP headers as opposed to ASN.1?

9. Identify the layers of the OSI model corresponding to UDP and TCP. Explain how theseprotocols satisfy the requirements of these layers?

10. Why does IP, which runs over Ethernet, create its own type of addresses and not usethe addressing provided by the Ethernet layer.

11. For TCP, explain the process of:

(a) connection creation(b) sequencing(c) dealing with lost packets(d) flow control(e) connection termination

12. Suggest a way in which UDP could be introduced into a client/proxy/server HTTP sit-uation without changing either clients or servers. What potential advantages couldresult?

13. Some new Internet based protocols are layering themselves above UDP rather TCP.Suggest reasons as to why they would have made this choice.

14. Two machines are communicating. One is switched off, and on again. What effect wouldthis have on communication using:

(a) UDP(b) TCP

15. Ethernet is capable of broadcasting packets. Which of the following protocols are alsocapable of using broadcast?

(a) IP

Page 27: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

5.1. EXERCISES 27

(b) TCP(c) UDP

16. Would a server listening for UDP packets on port 80 receive TCP packets directed tothat port?

17. Why are port numbers restricted to the range [0-65535]?

18. What is the largest IP packet that can be sent, and what happens if it is sent overEthernet?

19. Flow control should be invoked when the network is congested. How can TCP deter-mine if this is the case?

20. What other mechanism can TCP employ for flow control?

21. Why do TCP and UDP packets need to specify both source and destination ports?

22. IPX and IP are both network layer protocols. Why do we not find any IPX packets onthe Internet?

23. Can broadcast packets be sent on a Token Ring network?

24. Is it feasible to connect a Token Ring and an Ethernet LAN: specifically are the ad-dresses compatible?

25. Which is a better device to use for connecting a Token Ring and an Ethernet LAN: abridge or a router?

26. What is the future for Token Ring?

27. Given that a Token Ring network needs to see a token every 10ms, what limitationwould that impose on the size of the network?

28. What fields are required in the frame of a Token Ring token?

29. How many stations could be placed on an FDDI network if the maximum distance of2km between stations is used?

30. FDDI uses a signalling mechanism called NRZ-I, which inverts the signal for every 1bit. Encode the sequence 00001111 using NRZ-I.

31. FDDI recodes every group of 4 bits as a 5 bit sequence with no more than 3 consecutive0s. Why?

32. What is the benefit of using ADSL over PRI ISDN?

33. Americans can get a T1 Internet connection which runs at 1.544Mbps. Europeanswould get an E1 connection, at 2.048Mbps. How is this related to ISDN services?

34. Would real-time multimedia traffic prefer fixed size, or variable size packets?

35. In what circumstances would fixed path routing be preferable to routing down the leastcongested link?

36. How can we use 100BaseT for Gigabit Ethernet?

37. Which of the layers and protocols encountered to date deal with issues of addressing?

38. How does a machine find out its own IP number?

Page 28: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

28 CHAPTER 5. NETWORK PROTOCOLS: NETWORK LAYER

39. Part of the IP configuration includes the specification of a netmask. The netmask usu-ally used within the local network is 255.255.248.0. What is the significance of thisparameter?

40. How can you determine if a TCP service is running on a particular port of a particularmachine?

41. TCP provides a flow control mechanism which kicks in when the network is congested.How does it tell that the network is congested?

42. Set a challenging question covering material from this chapter and answer it, providingfurther insight into the issue than is already covered by these notes.

Page 29: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Chapter 6

Network Design

6.1 Exercises1. Design a Network:

Two of the departments in the university are about to be rehoused, and jointly needto install a new computer laboratory. This laboratory will occupy two adjacent rooms,with each room containing 45 machines. The departments require:

(a) Each laboratory must be capable of operating independently. It should be possibleto disable the network in each room separately, and at a single point.

(b) The two laboratories should be capable of being combined for use with large classes.(c) Each laboratory requires access to its own NT server. Both laboratories require

access to the same Linux server.

Draw up a network design for situation, for each of the scenarios depicted below. Foreach diagram, mention any design decisions which have influenced your solution.

(a) Satisfy the requirements using the cheapest possible solution.(b) Satisfy the requirements using Ethernet technology only.(c) Given access to all of the data link protocols covered in this course, and an unlim-

ited expense account, what changes would you make to the previous model.

2. Draw a simple network topology for a statistics computer lab on your campus. Why isthe topology you selected the best choice for the lab?

3. What is a fat pipe? Why is it important to use this concept in your network design?

4. A wealthy Texan Oil Tycoon, and an astute young South African university studenteach become enamored with fractal rendering. They intend to set up companies torender fractals on demand, and sell the resulting images. The faster they can producethe images, the more profit they get. Each raises a loan which covers the purchases of25 machines, 10 with fractal computing cards, and 15 with image display cards. Eachmust fund the network link from personal funds.

(a) Design a network to satisfy the requirements of the intrepid university student.(b) Design a network to satisfy the requirements of the oil tycoon.(c) The student decides to distribute his/her images over the Internet. Show what

extensions to his network would best accomplish this goal, and suggest how thesecould be phased in as finances permitted.

29

Page 30: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

30 CHAPTER 6. NETWORK DESIGN

5. An innovative South African businessman decides to create a Competitive ShoppingCafe. This will consist of a room with 20 PCs for customers allowing them to conduct E-commerce transactions over the Internet. His innovation is a bank of 15 servers whichwill each connect to a few of the most popular shopping sites and communicate amongstthemselves to determine the lowest price for each particular product.

(a) Discuss the expected traffic patterns on this network.(b) Design an initial network layout. Factors to consider are cost and expansion.(c) Suggest ways in which the business will grow, and show how this will affect the

design of the network.

6. South Africa contains a number of universities, each which contain a number of depart-ments, each which have computers in laboratories and offices. Each computer needs tohave access to the web. Design a network to facilitate this access, using proxy serversat strategic points, by following the steps below.

(a) Discuss the expected traffic patterns on this network.(b) Show the network layout, explaining the advantages of your design.(c) Show the positioning of proxy servers and describe their communication strategies.

7. Design a network to support the requirements listed below. Draw the network layout,and explain how your network satisfies each requirement.

(a) The building contains two departments, department A occupies the upper twofloors of a three story building, and department B occupies the bottom floor.

(b) Each department has its own set of servers. In addition, there is a global serverused by both departments.

(c) The top floor is occupied by a 35 machine laboratory which requires access to de-partment A’s servers, and to the global server. Traffic from this laboratory mustnot impact on the performance of the rest of department A’s network.

(d) Excluding the laboratory, department A has 10 machines, and department B has15.

(e) Finances are limited, but substantial growth is expected in department A in thenear future.

8. A large Hollywood based consortium wants to invest in a production studio for pro-ducing computer animated movies in South Africa, where the cheap labour can be ex-ploited. Design a network for them, containing the following features:

(a) Animators (from various companies) wish to work in a large open plan area wherethey can freely exchange ideas, but must be able to save work on a server dedicatedto their company. Typically 50-100 animators will be employed at any one time.

(b) A large rendering farm must be able to retrieve scene description files from a cen-tral server, distribute the rendering workload over about 1000 stations, and uploadthe finished frames back onto centralized storage.

(c) A production facility will be made available, for writing sequences of renderedframes to film or tape.

(d) Facilities to upload complete animation sequences to studies in Hollywood are re-quired.

Create the network design in the following steps. For each design step, explain theadvantages and disadvantages of your design.

Page 31: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

6.1. EXERCISES 31

(a) Estimate the amount of traffic involved in each part of the network.(b) Design a pilot network supporting 10% of the total capacity, to be part of the in-

vestment proposal.(c) Show the design for the complete network, showing which pieces of the pilot net-

work you would reuse. Cost effective design is very important.(d) The rand strengthens against the dollar as Georgie Bush is impeached for incom-

petence. Imported networking equipment becomes cheap. Describe the changesyou would make to your design.

9. Before designing a network for a client, what parameters of the network do you need toknow?

10. The Computer Science Department has come up with a radical new concept. Two newresidences will be constructed under the Hamilton building and 3rd year ComputerScience students will be housed there. Each student will spend 24 hours per day ina cubicle equipped with a floor luxuriously strewn with a layer of straw, a networkconnection and a computer. Lectures will be transmitted in as video files for 12 hoursa day and 8 hours per day will be spent on practical exercises. During the copious idletime, the machines will be configured as rendering servers.

(a) Assuming 90 students, design a suitable network. Indicate any assumptions re-garding cost and performance. Include the infrastructure required to support thisarrangement, and illustrate how your design would integrate into existing net-work facilities.

(b) Since the idea is likely to catch on, show how your network could be expanded asthe local facility grows (and we dig deeper).

(c) Show how the network could expand as we integrate new campuses at Pofadderand Nelspruit.

11. Give an example of:

(a) CBR traffic(b) VBR traffic

12. A telecommunications provider has 5 customers needing a 50Mbps CBR service. Thetraffic will be transmitted over an OC3 (155Mbps) link.

(a) What networking technology could be used?(b) How can the bandwidth contention be resolved?

13. Which networking technology would give:

(a) Cheapest LAN(b) Fastest LAN(c) Fastest WAN(d) Most reliable LAN

14. What technology would provide:

(a) fastest routing(b) cheapest routing

Page 32: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

32 CHAPTER 6. NETWORK DESIGN

15. Telkom puts out a request for bids to supply switches for its ATM core network. Allsuppliers must supply one sample unit, which will be forfeited if the bid fails, andremain part of the Telkom network. Is this a good idea?

16. Why should cycles be avoided within an Ethernet network? What difference betweenEthernet and ATM allows cycles to occur within ATM networks?

17. An FDDI backbone is used to connect a switched Ethernet workgroup to a server. Isthis a good design?

18. A hub is used as a backbone for a number of switched Ethernet workgroups. Is this agood design?

19. Would a “server farm” or a “distributed server” model be better for a network containingredundant (duplicate backup) servers?

20. An Ethernet network is wired with 10Base2, and has a number of stations each broad-casting 100 packets per second of 1500 bytes each. How does the amount of traffic onthe network vary with the number of machines?

21. Why would one use a backbone Ethernet switch in a LAN, rather than an IP router?

22. Suppose a packet is being sent to another machine far across the Internet. What Eth-ernet destination address is placed in the Ethernet header for the packet?

23. Design a network architecture that allows a number of client machines to communicatewith a single server.

24. How can one monitor the load on a network device such as a switch or router?

25. What other aspects of a network device would be worth monitoring or managing?

26. Identify flaws in the network design shown in Figure 6.1.

27. Set a challenging question covering material from this chapter and answer it, providingfurther insight into the issue than is already covered by these notes.

Page 33: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

6.1. EXERCISES 33

Multiple switches for redundancyin the backbone

Server for workgroup 1

Server for workgroup 2

Server for workgroup 3

Workgroup1 Workgroup 2 Workgroup 3

100Mbps links

1Gbps links

To Internet

Telco/LAN Router

SwitchEthernet

SwitchEthernet

SwitchEthernet

SwitchEthernet

SwitchEthernet

SwitchEthernet

HighSpeed

Disk Server

HighSpeed

Disk Server

HighSpeed

Disk Server

Figure 6.1: A questionable network design.

Page 34: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

34 CHAPTER 6. NETWORK DESIGN

Page 35: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Chapter 7

Network Analysis

7.1 Exercises1. Design a Petri Net corresponding to the following scenario. A single client goes through

three stages: Sending a message to the server, waiting for a reply from the server andprinting out the results of the reply. The single server goes through four stages: Waitingfor a message from a client, printing out the message, calculating a value, and sendingthe reply back to the client. Ignore the details of the printing process at the moment.

2. Extend the net designed in part 1 to include a print queue. The print queue must bufferall jobs that are sent to it, and send an acknowledgment to the server when a print jobfrom the server is complete.

3. Extend the net designed in part 1 to use two servers. The client must use each server asintensively as possible - there should never be a case of the server sitting idle, becausethe client is waiting for a response from the other server.

4. Classify each of the following Petri Nets according to whether they are: Safe, k-bounded,live and conservative:

a) b) c)P1

P2P3

P1

P2 P3

P1

P2P3

P4

T1

T2

T3 T1

T2

T1

T2T3

5. The following Petri Net is a model of a nuclear power plant. It will blow up if:

• The core temperature reaches 3500K.• The fuel rods in the building are stolen by terrorists (who will then construct a

small nuclear device, and detonate it in the plant)

Assume that each token represents a fuel rod, and that each rod in the reactor coregenerates a temperature of 1000K. Would you live next door to this reactor? Explain

35

Page 36: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

36 CHAPTER 7. NETWORK ANALYSIS

your reasoning.

P1 − fuel rods in the core

P2 − fuel rods being cleaned

T2 − replenish core

T3 − rods are inspectedT4 − rodsreturned tostorage

inspector 1P3 − checked by

inspector 2P4 − checked by

P5 − fuel rods instorageT1 − exchange rod

for cleaning

6. Draw the reachability tree, and determine the properties of the Petri Net shown below:

P0

P1

P2

P3

P4

P5

T0

T1

T2 T3

Page 37: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

7.1. EXERCISES 37

7. Design a Petri Net to model an HTTP server, with 3 clients. Each client may send arequest, wait for the response, and spend a while reading the page. The server canaccept one request at a time, retrieve the requested page, and send the response back.

(a) Draw the net, and explain the meanings of all places and transitions.(b) Determine the properties of your Petri Net.(c) What changes would be required to allow the server to handle two requests simul-

taneously?

8. Design a program that simulates a Petri Net. In particular list the fields and methods(with comments) for Place and Transition classes. Supply the algorithm for firing atransition.

9. Time is often associated with Petri Net models by assuming that a transition will notfire instantaneously, but that a finite duration will elapse between consuming the to-kens from the input places, and placing tokens in the output places. Show how thesimulation algorithm can be used to simulate a Time Petri Net.

10. Create a Petri Net model of a simple E-commerce application, with one Shop, 10 prod-ucts and and one Customer. The events pertaining to the customer are:

• Request list of products• Receive list of products• Buy Product

The Shop on the other hand sees the following events:

• Receive request for list• Send list of products• Sell Product• Post product to customer

List the partial states of both Shop and Customer that are pre- and post-conditions forthese events. Create the Petri Net.

11. Design a Petri Net to model the retrieval of a web page from a server via a proxy by aclient. Create models for the following situations:

(a) One client, one proxy, one server.(b) Two clients, one proxy, one server.(c) Two clients, one proxy, three servers.

Remember to specify the partial states of the system, and the meaning of all places andtransitions.

12. A model of a pyramid investing scheme assumes each participant works as follows:

(a) Each participant requests 1$ from two other participants.(b) Each participant pays at most 1$ to one other participant in the scheme.

Show the states and events associated with one of these participants. Create a PetriNet model of a simple system with 3 participants. Is there any way for all of them tomake money?

Page 38: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

38 CHAPTER 7. NETWORK ANALYSIS

13. We want to create a model of the CSMA/CD operation of Ethernet. For this model, wewill assume that two stations exist on a single Ethernet segment. Each station hasthree packets that it wants to broadcast.

(a) Identify the participants in the model.(b) Identify the states of each participant in the model.(c) Identify the events that cause a change in state at each station.(d) Identify the states that must exist before each event can occur.(e) Identify the states that will exist after each event does occur.(f) Create the Petri Net corresponding to this system.(g) Determine the properties of this Petri Net.

14. We can model an unreliable network as one which drops every third packet. Create aPetri Net model of the Positive Acknowledgment with Retransmit aspect of TCP whichneeds to send ten packets from one machine to another. Determine the properties ofthe net. What is the maximum number of packets which would need to be sent by eachmachine?

15. Show the state (marking) of the following Petri Nets after three transitions have fired.

P1

P2

T1 T2

P1 P1

P2 P2

T2T1 T1

T3

T2

P3

16. Create a Petri Net modelling 3 (rich) students, each wanting to buy 2 beers from theRat, whose complete stock consists of 5 beers.

17. What do each of the following Petri Net structures correspond to in a physical system:

(a) place(b) transition(c) input arc(d) output arc(e) token

18. What would be the physical significance of the total number of tokens changing overthe different markings?

19. How can you tell if a system gets into a state where it cannot proceed any further?

20. Create the reachability tree for this Petri Net:

Page 39: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

7.1. EXERCISES 39

P1: Workers have n dollars.

T4: Government ministers buy 4x4

T3: Government prints money

T2: Government hires contractors

P2: Government has n dollars.P3: Banks have n dollars

T1: Government taxes workers

22

21. Calculate the boundedness, liveness and conservation properties of this Petri Net.

22. What does the conservation property imply about the state of the economy?

23. Create the reachability tree for this Petri Net:

P1: Traffic lights (Robots) green North to South

T1: Lights change to N−SP2: Traffic lights (Robots) green West to East

T2: Lights change to W−E

T3: Lights change while pedestrian crosses

P3: Pedestrian crossing green

T4: Pedestrian pushes buttonP4: Pedestrian crossing red

T5: Pedestrian finishes crossing

24. Calculate the properties of this Petri Net.

25. What do these properties imply about the reliability of the traffic control system.

26. What properties can be derived from an incomplete reachability tree?

27. What component of a Petri Net could have time associated with it?

28. Consider (try to create) a Petri Net to model a store (such as a queue) with a limit of 5elements.

(a) How do you detect overflow?(b) How do you detect underflow?

29. Suppose you model a system with m clients and n servers. You have separate eventsfor the client sending a request to a server, and the server sending the response back.How do the servers keep track of which client to reply to?

Page 40: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

40 CHAPTER 7. NETWORK ANALYSIS

30. Does the time taken to simulate a Petri Net have any relationship to the time requiredfor the system modelled by that Petri Net to run?

31. How can the use of random numbers be justified in a simulation?

32. Suggest another modelling technique that can be used for creating a computer simula-tion.

33. How does one measure performance using a computer simulation.

34. What benefits could result from performing a computer simulation.

35. A local pharmacy has 3 shop assistants, 2 customers, and 3 drugs. Each customer willmake 2 attempts to buy a drug. Each attempt requires 2 assistants to retrieve the drug,and offer moral support. On seeing the price, the customer will make a 50/50 choice asto whether to buy the drug or not. Model this system using a Petri Net.

36. A Petri Net is live if there is a transition enabled in every state. Is this Petri Net live?What is the implication for the system that the Petri Net models?

37. A Petri Net is conservative if the total number of tokens in each state is constant. Isthis Petri Net conservative? What is the implication for the system that the Petri Netmodels?

38. A place in a Petri Net is k-bounded if the number of tokens in that place never exceedsk. What is the boundedness of the places in this Petri Net? What is the implication forthe system that the Petri Net models?

39. The safeness property for Petri Nets is equivalent to 1-boundedness. Why is 1-boundednesstreated as a special case?

40. The following are three markings from a larger reachability tree: (1,0,0,1), (2,0,0,0),(0,1,0,1). What deductions about the liveness, safety, boundedness and conservation ofthe corresponding Petri net can you make from this sample?

41. Create a Petri Net model of a networked client-server system with 3 clients and 2servers. States of a client include: ready to send a request, and waiting for aresponse. States of the server include waiting for a request and preparing a re-sponse.

42. How can one predict the performance of a system using a Petri Net model?

43. How can a Petri Net model deal with performance issues when the time taken for anevent is not constant (such as lecture events which takes 45±5 minutes).

44. What does a reachability tree for a timed Petri Net look like?

45. How does one calculate performance from a simulation?

46. How long must a simulation run for?

47. Set a challenging question covering material from this chapter and answer it, providingfurther insight into the issue than is already covered by these notes.

Page 41: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Chapter 8

Network Management andMonitoring

8.1 Exercises1. You are contacting vendors about purchasing a new router. Some vendors support

SNMP while others support CMIP. Which vendor would you choose? Why?

2. What is MIB? How is it used?

3. Explain the following terms:

(a) MIB(b) ASN.1(c) BER

4. How does the use of the Basic Encoding Rules compare to the encoding of the headerfields used in Ethernet, IP, UDP and TCP?

5. Give the full symbolic and numeric MIB path names as well as ASN.1 specifications forthe following variables:

(a) sysDescr(b) sysUpTime(c) IfInOctets

6. Compare a UDP client-server fractal rendering system to an SNMP agent-managerpair, showing any correspondences between components and protocols that may exist.

7. In what ways would network management be useful in an E-commerce environment?

8. Describe how network management could be applied to web proxy servers:

(a) How could SNMP be used for management in this scenario?(b) Suggest MIB variables that would be used for management (either specify your

own, or reuse others that already exist). Specify at least the syntax, descriptionand position in the hierarchy of the variables used.

9. How could network management be used to provide fault tolerance in a networkedrendering farm?

41

Page 42: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

42 CHAPTER 8. NETWORK MANAGEMENT AND MONITORING

10. What aspects of a computer network require management?

11. With reference to the MIB description below:

dot3StatsTable OBJECT-TYPESYNTAX SEQUENCE OF Dot3StatsEntryMAX-ACCESS not-accessibleDESCRIPTION "Statistics for a collection of ethernet-like

interfaces attached to a particular system. There will be one rowin this table for each ethernet-like interface in the system."

::= { dot3 2 }dot3StatsEntry OBJECT-TYPE

SYNTAX Dot3StatsEntryDESCRIPTION "Statistics for a particular interface to an

ethernet-like medium."::= { dot3StatsTable 1 }

Dot3StatsEntry ::= SEQUENCE {dot3StatsIndex InterfaceIndex,dot3StatsAlignmentErrors Counter32,dot3StatsFCSErrors Counter32,dot3StatsLateCollisions Counter32 }

dot3StatsIndex OBJECT-TYPESYNTAX InterfaceIndexMAX-ACCESS read-onlyDESCRIPTION "An index value that uniquely identifies an

interface to an ethernet-like medium."::= { dot3StatsEntry 1 }

dot3StatsAlignmentErrors OBJECT-TYPESYNTAX Counter32MAX-ACCESS read-onlyDESCRIPTION "A count of frames received on a particular

interface that are not an integral number of octets in lengthand do not pass the FCS check."

::= { dot3StatsEntry 2 }dot3StatsFCSErrors OBJECT-TYPE

SYNTAX Counter32DESCRIPTION "A count of frames received on a particular

interface that are an integral number of octets in length but donot pass the FCS check."

::= { dot3StatsEntry 3 }

(a) Show the portion of the MIB tree described here for 802.3 (Ethernet).(b) Why does the MIB specification include type information?(c) What would variables such as dot3StatsAlignmentErrors be used for in a network

management system?(d) What would the numeric path for the variable dot3StatsFCSErrors be (relative to

dot3)?(e) Why are some entries marked as not-accessible?(f) What network hardware manufacturers such as Cisco and Nortel do when they

create a new device with additional facilities that can be monitored? In particular,how would existing management system become aware of this additional function-ality?

Page 43: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

8.1. EXERCISES 43

(g) What security features would you expect to find in the latest version of the SNMPspecification?

12. Suggest some devices on a network that may contain SNMP agents?

13. What managed quantities would be found under the IP branch of the MIB tree?

14. The program snmpwalk provides the following output. What is it doing, and whatmethods of the protocol is it using?

$ snmpwalk -c public -v 1 146.231.120.1 systemSNMPv2-MIB::sysDescr.0 = STRING: Passport-8610 (3.3.3.0)SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.2272.30SNMPv2-MIB::sysUpTime.0 = Timeticks: (43903900) 5 days, 1:57:19.00SNMPv2-MIB::sysContact.0 = STRING: [email protected]::sysName.0 = STRING: NORTEL8600BSNMPv2-MIB::sysLocation.0 = STRING: HamiltonSNMPv2-MIB::sysServices.0 = INTEGER: 6

15. Should a network management station be located in the server room along with allother key network devices and servers?

16. Which is more important: speed (response) of a network, or reliability?

17. Set a challenging question covering material from this chapter and answer it, providingfurther insight into the issue than is already covered by these notes.

Page 44: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

44 CHAPTER 8. NETWORK MANAGEMENT AND MONITORING

Page 45: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Chapter 9

Network Security

9.1 Exercises1. Most operating systems lose all file access control if the machines are booted up with

a boot floppy containing a program that can interpret the values on the sectors of thehard drive, and reconstruct a view of the file system.

(a) Why can this sort of program not be used when the operating system is running?(b) Windows NT comes with a new type of file system for which documentation is not

easily available. Is this an adequate solution to this problem?(c) How does the use of networked file servers alleviate this problem?

2. Most server programs written in C make use of the string library to read in requestsfrom clients (possibly via the network). Most of these functions only specify the amountof memory required after they have copied values into it. This allows clients to over-write portions of memory on the server, possibly altering the code for the server.

(a) How could this cause security problems.(b) Suggest ways in which this problem could be prevented.(c) Is there any way to detect when a program has been corrupted in this way?

3. Unix provides the rlogin mechanism which allows users on specific machines to log into other machines without having to type in a password.

(a) In what circumstances would this be good for the security of a system.(b) In what circumstances would this be bad for the security of a system.

4. How does a firewall work? If you have a network that is connected to the Internet,where would you put a firewall?

5. How are viruses transmitted through the Internet?

6. Consider a company which is selling images of fractals over the Internet. How shouldit make use of firewalls to prevent:

(a) Illegal use being made of its computation servers.(b) Illegal access to its archive of images on a HTTP server.

7. What is private-key data encryption?

45

Page 46: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

46 CHAPTER 9. NETWORK SECURITY

8. Describe ways in which network security can be applied in E-commerce applications.

9. What sort of security measures are available during any transaction over the web?

10. An E-commerce company needs to ensure the security of its networks.

(a) Which operating system would be most suitable for the e-commerce servers. Mo-tivate your answer by describing the security architectures of the contending sys-tems.

(b) Design a secure network for the company. Show the network layout diagram andlist the security features of your design.

(c) Explain how the company can use RSA encryption to improve security.

11. Consider the vulnerabilities described in section ??.

(a) Are there any systems that are invulnerable to security related problems?(b) What steps would you take to securing a host/network?(c) How would you go about determining if your host/network security had been com-

promised?

12. The payload of the TELNET protocol consists of the ASCII text of a command linesession with another machine (the keystrokes sent from one side, and the responsesprinted from the other). What security problems could this pose?

13. Other Internet protocols (such as HTTP, SMTP) also use ASCII text. What are thealternatives? What are the pros and cons of each approach?

14. How can you find out what machines are connected to a network?

15. How can you find out what services each machine is running?

16. How can a packet filtering firewall prevent a network from revealing this information.

17. What advantages are there to attacking the network from a machine within the net-work?

18. How can we defend against packet sniffing?

19. How can we defend against scanning?

20. Can we defend a service on port 50000?

21. What is fundamentally insecure with the following code:

char packetbuffer [100];int i = 0;while (dataAvailable (socket))

read (socket, packet + i, 1)

22. What is fundamentally insecure with the following code:

char * filename = parseFileNameFromPacket ();char * message = parseMessageFromPacket ();changeDirectory (“/tmp”);file = fopen (filename, “w”);fwrite (message, strlen (message), 1, file);fclose (file);

23. Set a challenging question covering material from this chapter and answer it, providingfurther insight into the issue than is already covered by these notes.

Page 47: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

Appendix A

Solutions

A.1 Solutions to exercises: Section 1.11. Research the HTTP protocol.

(a) What is it used for?It is used to transfer the hypertext documents in HTML format on the world wideweb. (See RFC 1945)

(b) What does the acronym stand for.Hypertext transfer protocol.

(c) Does it operate in client-server or peer-to-peer setting?Client-server.

(d) Imagine that you are using HTTP to provide a service for a large company. Whatnetwork topology would be best suited to providing this service, and why?A large company may operate several web servers which may have substantialnetwork traffic to each on the company intranet. A star topology (or mesh) wouldallow access to each with minimal interference. For a company providing serviceson the Internet, all requests to the server may be funneled through a single gate-way, and so a bus topology would be acceptable, provided the speed of the bus wasgreater than that of the gateway.

(e) Describe a typical session between two machines running this protocol.The client opens a connection to the server, sends it a request, receives the re-sponse and closes the connection.

(f) Telnet to port 80 on a local machine providing HTTP service, and issue a simplerequest. What is the response, and how should it be interpreted?The session may appear as follows:[cssb@monza]$ telnet www.cs.ru.ac.za 80

Connected to hanoi.cs.ru.ac.za (146.231.24.200).Escape character is ’^]’.GET http://www.cs.ru.ac.za/index.html HTTP/1.0

HTTP/1.1 200 OKServer: Microsoft-IIS/4.0Date: Mon, 21 May 2001 08:15:42 GMTContent-Type: text/htmlAccept-Ranges: bytesLast-Modified: Thu, 17 May 2001 21:03:00 GMT

47

Page 48: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

48 APPENDIX A. SOLUTIONS

ETag: "01a32c114dfc01:2eb5"Content-Length: 12289

<HTML><HEAD><meta name="description" content="Computer Science, Rhodes University,... and additional HTML document.

2. Consider an application to draw images of fractals. The structure of the program is asfollows:

For all the points on the screenCalculate the colour of that point in the fractal.Draw a point of that colour in the appropriate position.

(a) What is a fractal?A Self Similar Image (See Fractals FAQ for more details)

(b) Suggest modifications to this program that would allow it to use a network to sharethe computing load amongst a number of computers, but only display on a singlestation.

ClientWhile (undrawn point)

Send request to server ii = i + 1 mod number of serversif (response from a server)

Plot PointServer

Receive request from clientPerform calculationSend reply to client

Lost packets are automatically resent when the client notices that they haven’tbeen drawn.

(c) Suggest modifications to this program that would allow it to use a network todisplay on multiple stations without recomputing the colours for each station.

ClientWhile (undrawn point)

Send request to serverif (response from a server)

Plot PointServer

Receive request from someonePerform calculationSend reply to originator of request

3. Describe the types of networks:

(a) LAN(b) MAN(c) WAN

Page 49: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.1. SOLUTIONS TO EXERCISES: SECTION 1.1 49

LAN MAN WANLimited Distance (Single Building) Covers a city Country or worldwide

High Speed Provided by third party carrierLow Error

4. Trace the development of networking technology over the past ten years. What newcapabilities do you predict for the next five years?Activities over past ten years include:

(a) Introduction of file server technologies(b) PCs become workstations(c) Thick Ethernet evolves to thin Ethernet(d) Printers can be networked on print servers(e) File server come of age(f) Fiber optics adds distance and speed to networks(g) Bitnet, Arpanet, and other early networks evolve into today’s Internet(h) 10 Mbps is evolving into 100 Mbps

Developments over the next five years:

(a) More wireless solutions(b) Even more people telecommuting(c) New networking equipment to accommodate growth of the Internet(d) Faster and faster communications well into the GB range(e) Extensive growth in the involvement of telephone and cable TV companies(f) Greater need for voice and video with data communications for teleconferencing,

virtual teaching, and long distance communications

5. Why is it becoming more difficult to distinguish between LANs, MANs, and WANs?Will there continue to be a need for the term LAN?Advances in network equipment make it easier to link individual networks into one.Examples include linking networks in two buildings into one. Linking networks acrossa city into one. One file server can be shared across remote sites. High-speed networksare reducing barriers even more. There may be good examples at your campus site ofdepartment, building, or branch campuses forming one network. The term LAN is stillhelpful in terms of distinguishing specific network sites.

6. How many terminators are used in a ring topology?None. Ring topologies are continuous and do not use terminators.

7. Which media access method provides the best security? Why?Fiber optic cable because expertise and the right tools are required to tap into it

8. What are three methods used for multiplexing? Which method works best for high-speed data transmissions?Time division (uses time slots) , frequency division (uses frequencies for different chan-nels), and statistical (by communication and application requirements). Statisticalworks best for high-speed transmissions.

Page 50: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

50 APPENDIX A. SOLUTIONS

9. What are the advantages to using twisted-pair instead of coax cable?Twisted-pair has these advantages: more flexible, low cost, connectors are cheaper, con-nectors are more reliable and less susceptible to damage, easier to make connections,easier to troubleshoot, and there are more options for high speed networking.

10. Design a simple E-commerce application. Your application should consist of at leasttwo classes: Customer and Shop. Customer will request a list of the items in the shop,together with the price of each item. It will then choose a selection of these items, andinteract with the Shop to purchase them. This will continue until the Customers runout of money, or the Shop runs out of products. List the methods through which theCustomer and Shop will interact, and specify the sequence in which these methods arecalled.The shop would support the following methods:

class Shop{

// number of products in the shop.int productsLeft ()// return the nth product, or NULL if n is out of range.void getProducts (int n, Product & p)/* attempt to buy the quantity of product specified.

Returns the amount actually sold. */int buyProduct (Product p)

};

The customer would then have the following methods:

class Customer{

// create a customer with a specific amount of money.Customer (int initialBalance = 100)// return the amount of money left.int Balance ()// get a list of products from the shop, choose some, and// buy them. Returns true if some products could be bought,// false if there is nothing available for the money.boolean buySomething (Shop & myshop)

};

The customer on being told to buy something would go through the following sequence:

• Build up a list of products in the shop (by getting the total number available, andthen getting the details of each individually).

• Select a product from the list.• Negotiate with the shop to purchase that item.

This design has the advantage that it could easily be implemented on a client (cus-tomer) server (shop) system.

11. Suggest ways in which an E-commerce application could maintain a shopping cart.An E-commerce shopping cart maintains a state for each customer, usually the itemsthat the customer is interested in purchasing. The shopping cart could be maintainedby the client application, but this then limits the ability of the shop to customize the cartto the nature of services that it provides. In addition, if the customer changes machines

Page 51: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.1. SOLUTIONS TO EXERCISES: SECTION 1.1 51

halfway through a transaction, all information would be lost. A better approach wouldbe to store the shopping cart on the server (shop) side. This requires that each customerhave an identification code that can be used to identify the appropriate cart.Many web based shopping carts are managed by the server, but stored locally on theclient machine (using cookies). This removes the need for each customer to identifyhim/her self, or log in, but does require that the client use the same machine (or atleast the cookie file) throughout the entire transaction. It will still allow the client toclose down the session and resume later without loss of state.

12. An E-commerce application relies on money changing hands when products are bought.Suggest a network architecture that support secure and efficient transfer of funds be-tween a Bank, Customer and Shop. Explain the order and type of communication be-tween these entities.A number of potential models exist. One such might be the idea of a virtual cheque. Thecustomer might connect to the bank, and after appropriate authentication will instructthe bank to create a cheque object containing the name of the customer, shop, and theamount. The bank may provide the customer with a reference number to this cheque.The customer can then contact the shop, ask for the goods and provide the referencenumber. The shop will then contact the bank and pass on the reference number. Thebank will verify the information, transfer the funds and delete the cheque. The shopcan then ship the goods.This model ensures that the shop will not be able to transfer funds without the cus-tomers approval, or transfer the same funds twice.

13. A HTTP proxy requests information from web servers on behalf of clients.

(a) Suggest some potential applications for such a proxy.Allows improved security and convenience by requiring that only one machine bevisible and connected to the external network. Allows content to be cached onthe proxy server, and screened to remove large or unwanted details. Allows therequests and responses to be adapted to site specific standards (perhaps knowledgeof faster mirrors of information). Allows HTTP traffic patterns to be monitored andshaped.

(b) How could a proxy be employed in a peer-to-peer environment? What networktopology would be best in this situation?Assuming peers are requesting data from other peers, a bank of proxy serversmay be used, one for each peer. This would reduce the load on the peers, if theproxies could cache responses. A bipartite mesh may be appropriate, with everypeer connected to every proxy. Alternatively, a single proxy could be deployed tocontrol traffic centrally, if running on a shared medium such as a logical bus.

(c) How could a single proxy be employed in a client-server environment? What net-work topology would be best in this situation?The proxy could be employed to control access to the server (or cache results). Astar of clients connected to the proxy, which then connects to the server may beappropriate.

(d) How could multiple proxies be employed in a client-server environment? Whatnetwork topology would be best in this situation?Levels of proxies (and caches if appropriate) could be used to control and reduceaccess to the servers. A tree structure would support such a hierarchical decompo-sition.

14. Explain the difference between circuit switching, packet switching and virtual circuits.

Page 52: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

52 APPENDIX A. SOLUTIONS

15. Wireless networks change many of the restrictions associated with cable based net-works. For each of the following topics, find out how they apply to a wireless network(for the wireless network of your choice):

(a) Network size(b) Topology(c) Multiplexing technique

16. Describe the topology, multiplexing and switching mechanisms of the following net-works:

(a) The national road network.(b) The entire road network in the country.(c) Railway network.(d) (Oral) Communication network within a company.(e) Network of aisles in the local supermarket.

17. List advantages of using a circuit switched network.

(a) Established connection so no contention over bandwidth.(b) Data is transmitted without the chance of losing sequence information.

18. List advantages of using a packet switched network.

(a) No need to establish a connection beforehand.(b) Can broadcast/multicast.(c) Provides a mechanism for multiplexing traffic from multiple sources.(d) Can more easily adapt to a variety of network topologies.(e) Multiple paths provide redundant connections.

19. Suppose three source machines each want to communicate with one of three destinationmachines respectively. What topologies could be used for a circuit switched network?How would this differ for a packet switched network?A mesh topology would be required to allow all possible combinations of circuits with 3machines connected to 3 other machines. All star topology with a central switch couldalso be used. A bus topology would suffice for the packet switched scenario.

20. Suppose three source machines each want to communicate with one destination ma-chine (such as a file server, for example). What topologies could be used for a circuitswitched network? How would this differ for a packet switched network?The target node would need three incoming links for multiple simultaneous circuits. Al-ternatively circuits would have to be established and removed for each communication.Packet switching is more capable of using an arbitrary network topology.

21. Compare circuit switching and packet switching in terms of:

(a) Reliability(b) Sequencing (ordering of data)(c) Speed(d) Cost

Page 53: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.1. SOLUTIONS TO EXERCISES: SECTION 1.1 53

Circuit switching:

(a) Establishes a connection before communication, so this guarantees that the otherparty is ready and that required bandwidth is available. Loss of data could comefrom noise on the wire or damage to the network during communication. If anexchange crashes, all existing calls must be reestablished.

(b) Data must arrive in the correct sequence, since all components follow the sameroute at the same speed.

(c) Speed is good for a single call, but multiple users must wait for shared circuits tobecome free.

(d) Circuit switching requires that sufficient cables (or channels) be available to han-dle peak load. You also pay for the times when you say nothing.

Packet switching:

(a) Data can be lost if sent to an already congested node, in additional to the normalphysical hazards.

(b) Datagrams can be reordered since each travels an independent route.(c) Efficient use can be made of the medium since datagrams from different sources

can easily be multiplexed together.(d) Packet switching moves the complexity from the leaf (edge) nodes to the switching

nodes.

22. What is the topology of the telephone network?In terms of:

(a) connection from phone to exchange: could be regarded as a bus, with phone, fax,modem all competing for the connection (or a party line).

(b) PABX: a star network with the PABX at the center.(c) Entire phone network: Mesh, exchanges with redundant links.

23. What would the IEEE 802 cable specification be for the cable connected to a (land-line)telephone.The rate would be about 64kbps. Communication is baseband, only one call at a time.Distance between exchange and home is about 2km. Thus 0.064Base20.

24. How can you tell what route your phone call takes?Without the cooperation of the telecommunications company, you can’t. The point isthat the interface provided offers a service that provides end-to-end communicationwith sequencing and reliability which can be provided by any underlying technologywith these properties.

25. How can you tell when packets arrive out of order on a packet switching network?One must tag each packet with some extra information: a header that perhaps has asequence number of the packet.

26. The binary signal is encoded into light pulses on the glass using a laser diode, andpicked up on the other end by a light sensitive diode.

27. The amount of data that can be transmitted in a given time.

Page 54: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

54 APPENDIX A. SOLUTIONS

28. Frequency division multiplexing (similar to the way in which multiple radio stationsshare the aether) - fixed bandwidth signals can be slotted into a region of the frequencyspectrum (the available bandwidth is divided up and shared among the communicat-ing parties). Code division multiplexing - frequency division multiplexing where thefrequency band is changed regularly.

29.

(a) Physically and logically, a star topology with the exchange at the center, and allsubscribers attached only to the exchange.

(b) Physically, a mesh topology with redundant links for reliability. Logically, datasees only a series of point to point connections, a set of independent buses.

(c) A physical bus, where all transmissions must share a common medium. Logically,a star since all communication is between handset, and central tower.

30. Broken up into packets, where each packet is given an address. Each packet finds itsown path through the network.

A.2 Solutions to exercises: Section 2.11. Show the HTTP protocol, as used on the local network, in relation to the OSI model.

Describe the services provided by the protocol which match the functionality expectedat each level.

7: Applications: The web server needs to access local files, and to transfer files be-tween server and client. Such issues as file access and transfer, virtual terminalemulation, interprocess communication and the like are handled here.

6: Presentation: Differences in data representation are dealt with at this level. Forexample, UNIX-style line endings (CR only) might be converted to MS-DOS style(CRLF). HTTP in particular specifies MIME encodings for different file types.

5: Session: Communications between applications across a network is controlled atthe session layer. The client-server nature of HTTP defines the two-way commu-nication at this level.

2. Research HTML.

(a) What is HTML and how does it compare to HTTP.HTML is the hypertext markup language and is the format used for most webpages. It is just one of the file types that can be transferred using the HTTP.HTML specifies the formatting of a file, and nothing about its communication overa network.

(b) Create a web page, containing:i. Title.

<Title> My title </Title>ii. Heading.

<H1> My heading </H1>iii. List of items.

<UL> <LI> my list item </LI> <LI> my next list item </LI> </UL>and preview it under your favourite browser.

3. Explain how the OSI model specifies fail-safe techniques to ensure data arrive at theirdestination accurately.

Page 55: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.2. SOLUTIONS TO EXERCISES: SECTION 2.1 55

Session: Testing for out-of-sequence packets.Transport: Makes sure the lower three layers are doing their job correctly, and pro-

vides a transparent, logical data stream.Network: Routing and flow control are performed here makes sure packets are ad-

dressed and arrive at the destination.Data Link: error detection and correction and retransmissionPhysical: Cable, connector and signalling specifications are defined, to prevent signal

loss through incorrect wiring.

4. Why is a layered network architecture an advantage?Peer protocols between nodes at the same layer level for known communications is oneexample. Dividing communication layers to perform specific functions enables each tospecialize in delivering a specific function with less overhead. Information already usedis stripped from one layer to the next, economizing on what needs to be sent. Frequenterror checking occurs from layer to layer.

5. What is a peer protocol? Why is it important?This is a communication vehicle used for node-to-node communication within the sameOSI layer. It is vital to have consistent communication guidelines between networkentities for reliable transfer of data.

6. Under what circumstances would you install a multi-port repeater?When there are several areas that need to be extended due to distance limitations orbecause more nodes need to be attached.

7. Describe how a bridge might be used to reduce network traffic problems.It can filter information from the given MAC addresses to reduce traffic on certainsegments.

8. Describe a network scenario where you would replace an existing bridge with a router.When would you employ a multimedia router?The strongest scenario is when routing is needed to reduce network traffic. Anotherreason is when firewall protection is needed. A third reason is to handle multi-protocoltraffic. The addressing structure offered by a router is more efficient for large networksthan the lookup tables maintained by a bridge. A multimedia router is needed to joinnetworks using different media, such as a network with Ethernet, FDDI, and tokenring.

9. Which flow control approach is more efficient? Illustrate your answer.

• Stop and go requires a complete round trip before each packet can be sent.• Sliding windows and the credit scheme are more efficient and can send additional

packets while waiting for acknowledgments from the first. Both can be adapted tothe speed of the network, and communicating parties by either varying the windowsize, or changing the rate at which credits are issued.

10. A simple client-server application consists of a client which requests sequences of neven or odd numbers, and a server which provides them. Design a suitable protocolfor this application, in particular specifying the format of the headers involved in theprotocol.The protocol can be extremely simple provided we are not concerned with issues ofpacket loss. Lost requests and responses are ignored in the protocol below. Thus theprotocol is as follows:

Page 56: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

56 APPENDIX A. SOLUTIONS

• Communication sequence: The client sends a single packet to the server contain-ing the number of numbers required (length of sequence), and a flag to indicatewhether it is odd or even. It then waits for that number of packets to arrive fromthe server. The server waits for requests, generates the appropriate numbers andsends them back, each in a separate packet. The structure of the protocol headeris:

struct protocol_header{

int length;boolean even;double number

}

The first two fields are used by client-server packets, and the last by the server-client responses.

• Reliability: responsibility of an underlying protocol.• Sequencing: ignored. The header could have a sequence number added to ensure

that the responses from the server are in the correct order.• Lost packets: ignored, as described above.• Duplicate packets: should not arise, since there is no retransmission.• Flow control: none. We assume that the client can handle the complete sequence

of packets sent by the server.• Addressing: responsibility of an underlying protocol.• Connection establishment: As described by the communication sequence above.• Connection termination: Terminates with last number is received from the server.

11. Design a protocol to provide a reliable stream of data and be implemented on top of aprotocol which provides an unreliable, packet based service. Show the header required,and explain how each field will be used to achieve the required service.This particular protocol (the Inefficient Retransmitting Protocol, version 5.00 - IRP5)will send each packet and retransmit it at regular intervals until it gets a response.Each packet received will immediately be acknowledge by a packet containing only theIRP5 header, and no data, with the ACK flag set.

• Reliability: Uses the underlying protocol.• Sequencing: Each packet will be numbered by the sender in increasing order, start-

ing at 0. (This may cause overlaps in sequence numbers from previous sessions).• Lost packets: Retransmit the packet every 5 seconds until an acknowledgment

packet for that sequence number is received.• Duplicate packets: The sequence number of any new packet must be greater than

that of the last packet received.• Flow control: None required, each machine can only transmit one packet before

requiring a response (acknowledgment) from the other.• Addressing: Uses the underlying protocol.• Connection creation: The first packet to arrive from another address is the herald

of a new connection. The only state that is associated with the connection is thesequence number of the last packet received.

• Connection termination: Connections will be discarded at 2 minutes of no traffic. Iftransmission is resumed, it will treated as the establishment of a new connection.The only danger here is the arrival of a very old duplicate packet. We will assumethe 2 minute timeout is sufficient to avoid these.

Page 57: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.2. SOLUTIONS TO EXERCISES: SECTION 2.1 57

• The header will consist of:struct protocol_header

{int sequence;boolean ack;

}

12. Identify the communication issues addressed by protocols at each level of the OSImodel.

• 7: Application:• 6: Presentation:• 5: Session: Sequencing• 4: Transport: Connection establishment, Connection termination, Lost and dupli-

cate packets.• 3: Network: Addressing, Flow control• 2: Data Link: Reliability• 1: Physical:

13. List the messages exchanged by the HTTP protocol during the retrieval of a web pagefrom a server by a web client.

14. Describe how the HTTP/TCP/IP/Ethernet protocol deals with the following communi-cation issues: Reliability, Sequencing, Lost Packets, Duplicate Packets, Flow control,Addressing, Connection Establishment, Connection Termination.

15. Suppose a proxy server is introduced into the HTTP client-server scenario. List themessages that need to be exchanged between the various components to retrieve a webpage.

16. For each of the following:

• Identify the communication issue that it addresses.• Explain briefly how it works.• Identify the associated layer of the OSI model.• Name a protocol that uses it.

(a) Cyclic Redundancy Code.(b) Sliding Window.(c) Port Numbers.(d) 3-way handshake.(e) Sequence numbering.

Solution:

(a) CRC: Error detection, calculates a check code by treating the message as a largebinary number and using the remainder of “division” by the CRC key, Data Link,Ethernet.

(b) Sliding Window: Flow control, limits the number of packets that can be in transit(for which no acknowledgment has been received), Network, TCP.

Page 58: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

58 APPENDIX A. SOLUTIONS

(c) Port Numbers: Addressing, extends the address space to refer to a single service(or socket) on a machine, Transport/Network, TCP or UDP.

(d) 3-way handshake: Connection establishment, an exchange of three messages tomake sure both parties agree on establishing a connection (and are aware of theother parties agreement), Transport, TCP.

(e) Sequence numbering: sequencing and lost packet detection, sequence number al-lows the order of packets to be determined, and lost packets to be detected, Session(and Transport for lost packet), TCP.

17. Explain 3 ways in which the OSI model specifies fail-safe techniques to ensure dataarrive at their destination accurately.

18. Switching and routing can occur at various layers. How is this possible, given that theintent of a layered model is to restrict specific functions to a single layer?

19. Suggest novel strategies for dealing with each of the following communication issues:

(a) flow control(b) lost packets(c) duplicate packets

Suggested strategies:

(a) Delay for a fixed time between packets. Delay for a random time between packets.(b) Send all packets three times.(c) Store checksums for all packets received, and delete any packets whose checksums

match that of a previous packet.

20. Suppose a picture containing 1000 lines, each containing 1000 pixels is transmittedover a 100Mbps network link.

(a) What is the shortest time required?(b) What factors will determine how closely we can reach this target time?

Number of bytes = 1000× 1000× 3 = 3000000. Number of bits = 8× 3000000 = 24000000.Time = 24000000

100000000 = 0.24s. Longer because parity bits added to each byte. Interpacketdelays and contention for the network.

21. Match each of the communication issues, protocols and OSI layers:

• Error correction, sequencing, connection creation, flow control, retransmitting lostpackets, data formatting and presentation.

• Ethernet, TCP, UDP, HTTP, 100BaseT.• Application, Presentation, Session, Transport, Network, Data Link, Physical.

ApplicationPresentation data format HTTP

Session sequencing TCPTransport connections, retransmitting TCP, UDPNetwork flow control IP, TCP

Data Link Error correction EthernetPhysical 100BaseT

Page 59: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.2. SOLUTIONS TO EXERCISES: SECTION 2.1 59

Layer 4

Layer 3

Layer 2

Layer 1

20 bytes from application

20 bytesHeader

25 bytes of data to next layer

30 bytes of data to next layer

35 bytes of data to next layer

40 bytes put on wire

25 bytes

30 bytes

35 bytes

5

5

5

5

40 bytes received from wire

Sender Receiver

Layer 4

Layer 3

Layer 2

Layer 1

20 bytes passed to receiving application

20 bytesHeader

25 bytes of data up to next layer

30 bytes of data up to next layer

35 bytes of data up to next layer

25 bytes

30 bytes

35 bytes5

5

5

5

Figure A.1: Four layers of encapsulation.

22. A four layer network model is given 20 octets to send. Each layer adds a 5 byte header.Sketch the way in which information is passed from one layer to the next.Layering as shown in Figure A.1.

23. Which issues must be resolved to make a packet switched network appear as a circuitswitched network (i.e. to provide virtual circuits)?Sequencing needs to be provided to ensure the components of the data stream beingsent arrive in the same order. Lost and duplicate packets must be corrected for. Con-nection establishment and termination facilities must be provided. Error checking isnot an additional requirement. Flow control would be convenient, but unless a guaran-teed quality of service is required, is not essential.

24. What advantages can be gained from using virtual circuits over a packet switched net-work, as opposed to a physical circuit switched network.Multiple calls can use the same cables, and idle time can be used by other users. Multi-ple virtual connections can be made over one physical connection (provided total band-width is not greater than can be handled by one physical link).

25. How does the Post Office address the following communication protocol issues:

(a) error detection(b) lost packets (letters)(c) flow control(d) addressing

Post Office does:

(a) Error detection: Can be measured from the water stains on the envelope or dentsin the box.

(b) Lost letters stay lost. Registered letters provide some information about where theletter is lost, but do not recover the letter.

Page 60: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

60 APPENDIX A. SOLUTIONS

(c) Flow control: The size of the post box limits the number of letters that can be sentor received.

(d) Addressing: Fairly obvious, the postal address on the envelope.

26. What relationship must exist between protocol stacks on the sending and receivingmachines?The same protocols must exist at the corresponding layers.

27. Suppose you invent an innovative new technique for detecting lost packets. How muchof the protocol stack needs to change to support this improvement?Only the layer containing the protocol that deals with lost packets. Other layers shouldnot be dependent on a particular protocol in another layer (although they may dependon that protocol correctly solving its given protocol issue).

28. Which communication issues would a protocol used for transferring e-mail have to ad-dress?E-mail could make use of virtual circuits, so would assume that these functions areprovided by other protocols. It would have to:

(a) Manage addressing, using email addresses.(b) Connection creation, to find and connect to the machine holding the recipients

mailbox.(c) Presentation issues, such as how to describe the format of attachments, or lan-

guage conventions to use.(d) Application issues, such as the size of messages that can be transferred.

29. At what level of the OSI model would you expect to find a protocol for transferringe-mail?Based on the previous answer, it would be found at the application and presentationlayers.

30. Why must issues of addressing be addressed at each of the Data Link, Network andTransport layers?The data link layer deals with communication between directly connected stations. Ad-dresses at this level use the MAC address assigned to the card. These are effectivelyrandom, but the small number of machines means that tables of address are feasibleto maintain. At the network layer, while routing between larger networks, a hierarchi-cal addressing scheme matching the structure of the network is required, so that rulescan be used to determine destination (sub)networks, rather than each individual host.The transport layer needs to be able to address services on the machines, and uses portnumbers to distinguish these.

31. In a client-server environment, how would the clients find the server?The server could be placed on a known machine, at a known port number. Clientsconnect to this, passing their own return address during the connection creation stage.

32. In a peer-to-peer environment, how would the peers become aware of each other?Either all peers must known of a service that advertises the presence of other peers, orall peers must advertise their existence.

33. Why are routers used in the Internet, rather than bridges.Bridges need a table entry for every host on the network. Routers need an entry onlyfor every network (which contains a number of hosts). Thus routers can handle largernetworks with less resource requirements.

Page 61: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.2. SOLUTIONS TO EXERCISES: SECTION 2.1 61

34. Latency refers to the time taken between the time at which a packet is sent, and thetime at which it is received. Rank network devices according to the influence they haveon latency.From least to most:

(a) Repeater: least, amplifies the signals as they pass without delaying them.(b) Switch: some delay to read and process the packet header, but can start sending to

the destination as soon as the header has past, even before the entire packet hasbeen received.

(c) Bridge: Reads in an entire packet, but needs to decode only up to the data linklayer.

(d) Router: Reads in an entire packet, and needs to decode up to the network layer toget the addresses to route on.

35. As with data corruption, the checksum in the packet will not match that calculatedfrom the packet data. It is not possible to identify where in the packet the problemoccurs, but in either case (data corruption or checksum corruption) the packet shouldbe discarded.

36. Packets from other connections may be on the network and could be mistaken for thosebelonging to this connection. In particular, if the machine has just restarted, then theseother packets could have the same address information.

37. Retransmit every packet three times. Repeat part of the data in other packets. Manysolutions exist for every issue.

38. This may be problematic if the route to the sender is congested in some way - whichmay be the case if “slow down” messages are required.

39. Divide the problem up into smaller modules that solve each issue independently. Eachmodule then has less complexity, and can easily be replaced by another module withthe same function but an improved implementation.

40. TCP predates the OSI model, and was designed according to the four layer ARPA model.Application FTP, SMTP, HTTPTransport TCP/UDPInternet IPNetwork Local LAN protocols (such as Ethernet)

41. Yes. Provide a transport layer protocol which implements streams (virtual circuits) bydoing nothing, but just exposing the underlying datagrams. Such a protocol as UDP.

42. Session may include sequence numbers, transport may include flags to indicate thestate of the connection (or connection negotiation), network may have addresses, data-link could include a checksum field.

43. It allows software to be modularized, so that protocols for specific communication issuescan be invented in isolation. A wide adopted standard can hamper innovation though.

44. There are pros and cons. The vertical decomposition avoids any interdependence of onemodule on another. It does mean that facilities (such as broadcast available on busbased networks) may not be available to higher level protocols that are presented witha more restricted interface.

45. TCP creates a virtual circuit between exactly two communicating parties. Thus broad-cast is not even meaningful.

Page 62: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

62 APPENDIX A. SOLUTIONS

46. The maximum value that can be represented with 2 bytes is 65535.

47. The server could always be present at a well known address. The server could registerwith some address serving server, which in turn lives at a well known address. Theserver could broadcast, giving adverts of its address.

A.3 Solutions to exercises: Section 3.11. Encode the following sequences of bits

• 111110000• 101011010

using:

(a) NRZ(b) Unipolar RZ(c) Polar RZ(d) Manchester Encoding

Answer: See Figure A.2

Manchester

Polar RZ

UnipolarRZ

NRZ

1 1 1 1 0 0 0 01 1 0 1 0 1 1 0 1 0

Figure A.2: Solution to encoding exercise

2. Divide the following bit stream into frames, assuming that it is using the HDLC flagfor framing:00101100110111111011011011111011000111111000111110011011111101111Answer0010110011 - 110110111111100 - 0011111011 - 1111

3. Calculate the following checksums on the data: 9 13, each represented as 4 bit binarynumbers.

(a) Sum of values, modulus 8.(b) Remainder, after division by binary value 101.

Which of these detect an error if the values 8 14 reach the destination?Answer:

Page 63: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.3. SOLUTIONS TO EXERCISES: SECTION 3.1 63

(a) Sum: (9 + 13) mod 8 = 22 mod 8 = 6Sum: (8 + 14) mod 8 = 22 mod 8 = 6 - does not detect error.

(b) Division: 9 13 create the bit sequence 10011101 mod 101 = (157 mod 5) = 2Division: 8 14 create the bit sequence 10001110 mod 101 = (142 mod 5) = 2 - alsodoes not detect error.

4. Encode the following sequences of bits

• 00011100• 10100011

using:

(a) NRZ(b) Unipolar RZ(c) Polar RZ(d) Manchester Encoding

Answer: See Figure A.3.

Manchester

Polar RZ

UnipolarRZ

NRZ

1 1 1 0 1 0 1 0 0 1 10 0 0 00

Figure A.3: Solution to encoding exercise

5. Divide the following character stream into frames. Each character is represent by aone/two/three letter code.DLE SOH NAK SYN DLE DLE SOH DLE STX FF NP M E S S A G E CAN ETB DLEETX DLE SOH BEL DLE STX H E L L O EM DLE ETXAnswer: header - NAK SYN DLE SOH - text - FF NP M E S S A G E CAN ETB - endtext - header - BEL - text - H E L L O EM - end text

6. Calculate the following checksums on the data: 3 8 7 5, each represented as 4 bit binarynumbers.

(a) Sum of values, modulus 8.(b) Remainder, after division by binary value 101.

Which of these detect an error if the values 4 8 8 5 reach the destination?Answer:

Page 64: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

64 APPENDIX A. SOLUTIONS

1 1 0 0 1 1 0 0

Figure A.4: Manchester encoding of 11001100.

(a) Sum: (3 + 8 + 7 + 5) mod 8 = 23 mod 8 = 7Sum: (4 + 8 + 8 + 5) mod 8 = 25 mod 8 =1 - detect error.

(b) Division: 3 8 7 5 create the bit sequence 0011100001110101 mod 101 = (14453 mod5) = 3Division: 4 8 8 5 create the bit sequence 0100100010000101 mod 101 = (18565 mod5) = 0 - detect error.

7. Encode the following sequences of bits

• 00110110• 10101111

using:

(a) NRZ(b) Unipolar RZ(c) Polar RZ(d) Manchester Encoding

8. Figure 3.1 shows a number of signals encoding the bit sequence 11110000. Identify thesignalling technique used in each case.

9. Decode the following signals shown in Figure 3.2.First one can only be NRZ: 111101000110. Second can either be NRZ (0010100010) orRZ (011010).

10. Encode the sequence 11001100 using Manchester encoding.Result shown in Figure A.4.

11. Break the following sequence into frames:X A T H E X B F O X X A N D X A A X B H O U N Dwhere X = DLE, A = SOH, B = SOT.Header 1: THE, Text 1: FOXAND, Header 2: A, Text 2: HOUND

12. How many bits in a byte?Normally 8, but some people have different opinions. Thus in networking, the termoctet is normally used to refer to an 8 bit value.

13. How fast does data travel on the network (and how long is a bit when transmitting at100Mbps)?Transmission speeds are usually about 2

3c, two-thirds of the speed of light in a vacuum.Thus a bit at 100Mbps takes 1/10000000 s to send, and cover 2·3×108(m/s)·s

3·100000000 =2m.

Page 65: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.3. SOLUTIONS TO EXERCISES: SECTION 3.1 65

14. How many bits can be in transit on a 100m piece of 100BaseT at any time?100m/2m = 50.

15. Encode the following bit sequence 11100011 using:

(a) NRZ(b) Polar RZ(c) Manchester encoding

1 1 1 0 0 0 1 1

NRZ

Polar RZ

Manchester

16. In how many ways can the following Manchester encoded sequence be interpreted?

Either as: 1111, or as 10101010. This should not be a problem since the receiving clockshould not differ from the sender by a factor as high as 2.

17. Frame the following message: 41 10 10 45 01 44 03, with header 64 65 66 where:

• DLE=10• SOH=01• STX=02• ETX=03

10 01 65 66 67 10 02 41 10 10 10 10 45 01 44 03 10 03

18. Why would one use more than 1 stop bit to resynchronize clocks using asynchronoustransmission?The start bit is always a 0 and tells the computer that new serial data is available.The remaining bits are called stop bits. There can be 1, 1.5, or 2 stop bits betweencharacters and they always have a value of 1. Stop bits traditionally were used to givethe computer time to process the previous character, but now only serve to synchronizethe receiving computer to the incoming characters. The stop bit has the value 1. Thusmore than 1 stop bit may be used to slow things down (a flow control mechanism).

19. How can we detect when the network is idle?The region between an ETX and the next SOH can be an idle value. Alternatively wecan allow the line voltage to float at an illegal value.

20. Yes, either by providing an additional line to carry a clock signal, or by encoding theclock signal in the data stream.

Page 66: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

66 APPENDIX A. SOLUTIONS

21. It might make the signal more susceptible to corruption by stray noise. However everypulse can now represent 2 bits, doubling the bandwidth.

22. Using NRZ: 101001101001011, or 110011000011110011000011001111, and so on forother multiples of each bit, since there is no information about the width of each bit.Three bits 110 can be decode as Unipolar RZ, but then the next pulse is too wide. It canencode as a Manchester encoded signal as: 00100110.

23.

−2.5V

−0.833V

0V

0.833V

2.5V

10 11 01 10 11

24. Losing zero bits from the start of the message will not be detected.

25. Using normal binary arithmetic:

101101 | 11011

101---0011000---111101---10

Thus 27 divided by 5 is 5 remainder 2.Using CRC modulo-2 arithmetic (no carry), and appending 3 zeros (number of bits indivisor)

111000 101101101 | 11011000 101 | 10011000 (Changed message)

101 101--- ---0111 0011101 000--- ---101 111101 101--- ---000 100

Page 67: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.4. SOLUTIONS TO EXERCISES: SECTION 4.1 67

101---00100101---

1

The CRC is 000 in this case, 001 with the message changed.

26. Data link layer deals with error detection.

A.4 Solutions to exercises: Section 4.11. Round trip time = 50µs, end to end time = 25× 10−6s. Thus:

end to end distance = speed ×time =2× 108× 25× 10−6=5000m

2. If we set the maximum round trip time to 1× 10−6, then:end to end distance = speed ×time =2× 108

× 1× 10−6=200mat 10Mbps, the number of bits in the round trip time is 10× 106

× 1× 10−6 = 10 bits.

3. Parameters:

• Time spent on 1 bit = 130Mbps = 1

30×106 = 3.33× 10−8s.

• Distance occupied by 1 bit = ct = 3× 108× 3.33× 10−8 = 10m

• The maximum length of cable allows the signal to travel up and down the cable in400ns. The length of cable = vt = 3× 108

× 2× 10−7 = 60m

• Minimum packet size is that required to occupy the entire round trip time: 30 ×106bits/s× 4× 10−7s = 12bits

(a) Transmit the following sequence of bits: 1,0,0,1 from station B to station C. Showthe state of the wire after successive intervals of T.A B C

Bits onthe wire10m

60m

At time t=0 A B CCS=N CS=N CS=NCD=N CD=N CD=N

Sending: 1,0,0,1 Received:• •

At time t=T A B CCS=N CS=Y CS=NCD=N CD=N CD=N

Sending: 0,0,1 Received:• ← 1B 1B → •

Page 68: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

68 APPENDIX A. SOLUTIONS

At time t=2T A B CCS=N CS=Y CS=NCD=N CD=N CD=N

Sending 0,1 Received:• ← 1B ← 0B 0B → 1B → •

At time t=3T A B CCS=Y CS=Y CS=YCD=N CD=N CD=N

Sending: 1 Received:• ← 1B ← 0B ← 0B 0B → 0B → 1B → •

At time t=4T A B CCS=Y CS=Y CS=YCD=N CD=N CD=N

Sending: Received:1• ← 0B ← 0B ← 1B 1B → 0B → 0B → •

At time t=5T A B CCS=Y CS=N CS=YCD=N CD=N CD=N

Sending: Received:1,0• ← 0B ← 1B 1B → 0B → •

At time t=6T A B CCS=Y CS=N CS=YCD=N CD=N CD=N

Sending: Received:1,0,0• ← 1B 1B → •

At time t=7T A B CCS=N CS=N CS=YCD=N CD=N CD=N

Sending: Received:1,0,0,1• •

(b) Consider the two cases of A and C transmitting simultaneously. The backoff timesfor A are: 2T, 7T and 17T, those for C are 1T, 3T and 13T.

i. They each transmit two bits. A transmits 1, 1. C transmits 0, 1. (belowminimum packet size)A B C

Bits onthe wire10m

60m

Page 69: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.4. SOLUTIONS TO EXERCISES: SECTION 4.1 69

At time t=0 A B CCS=N CS=N CS=NCD=N CD=N CD=N

Sending 1,1 Sending: 0,1• •

Although we should pad out the packet to minimum packet size in order toachieve transmission, in this case we will explore what can go wrong when thepacket size is too small.

At time t=T A B CCS=Y CS=N CS=YCD=N CD=N CD=N

Sending: 1 Sending: 1• 1A→ ← 0C •

At time t=2T A B CTransmission CS=Y CS=N CS=YComplete, no CD=N CD=N CD=N

collisions Sending: Sending:detected. • 1A→ 1A→ ← 0C ← 1C •

At time t=3T A B CCS=N CS=Y CS=NCD=N CD=Y CD=N

Sending: (leading edge collision) Sending:• 1A→ 1A→ ← 0C ← 1C •

At time t=4T A B CCS=N CS=Y CS=NCD=N CD=Y CD=N

Sending: Sending:• ∗ 1A→

0C←

∗ 1A→

1C←

At time t=5T A B CCS=N CS=Y CS=NCD=N CD=Y CD=N

Sending: Sending:• ∗0C← ∗1C← ∗1A→ ∗1A→ •

At time t=6T A B CCS=Y CS=N CS=YCD=Y CD=N CD=Y

Sending: Sending:• ∗0C← ∗1C← ∗1A→ ∗1A→ •

Stations A and B receive the collision. Since they have long since completedtransmission, they ignore it, from their point of view the packet was transmit-ted successfully. This is why there is a minimum packet length.

Page 70: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

70 APPENDIX A. SOLUTIONS

At time t=7T A B CCS=Y CS=N CS=YCD=Y CD=N CD=Y

Sending: Sending:• ∗1C← ∗1A→ •

At time t=8T A B CCS=N CS=N CS=NCD=N CD=N CD=N

Sending: Sending:• •

ii. They transmit 12 bits, the minimum packet size. A transmits 1, 0, 1, 0, 1, 0, 1,0, 1, 0, 1, 0. C transmits 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0.A B C

Bits onthe wire10m

60m

At time t=0 A B CCS=N CS=N CS=NCD=N CD=N CD=N

Sending 1,0,1,0,1,0, Sending: 1,1,0,0,1,11,0,1,0,1,0 0,0,1,1,0,0

• •

At time t=T A B CCS=Y CS=N CS=YCD=N CD=N CD=N

Sending 0,1,0,1,0, Sending: 1,0,0,1,11,0,1,0,1,0 0,0,1,1,0,0

• 1A→ ← 1C •

At time t=2T A B CCS=Y CS=N CS=YCD=N CD=N CD=N

Sending 1,0,1,0, Sending: 0,0,1,11,0,1,0,1,0 0,0,1,1,0,0

• 0A→ 1A→ ← 1C ← 1C •

At time t=3T A B CCS=Y CS=Y CS=YCD=N CD=Y CD=N

Sending 0,1,0, Sending: 0,1,11,0,1,0,1,0 0,0,1,1,0,0• 1A→ 0A→ 1A→ ← 1C ← 1C ← 0C •

Page 71: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.4. SOLUTIONS TO EXERCISES: SECTION 4.1 71

At time t=4T A B CCS=Y CS=Y CS=YCD=N CD=Y CD=N

Sending 1,0, Sending: 1,11,0,1,0,1,0 0,0,1,1,0,0• 0A→ 1A→ ∗ 0A→

1C←

∗ 1A→

1C←

← 0C ← 0C •

At time t=5T A B CCS=Y CS=Y CS=YCD=N CD=Y CD=N

Sending 0, Sending: 11,0,1,0,1,0 0,0,1,1,0,0• 1A→ ∗ 0A→

1C←

∗ 1A→

1C←

∗ 0A→

0C←

∗ 1A→

0C←

← 1C •

At time t=6T A B CCS=Y CS=Y CS=YCD=Y CD=Y CD=Y

Sending: Sending:1,0,1,0,1,0 0,0,1,1,0,0• ∗ 0A→

1C←

∗ 1A→

1C←

∗ 0A→

0C←

∗ 1A→

0C←

∗ 0A→

1C←

∗ 1A→

1C←

At this point, both stations A and C realize that their packets have collided,since a collision has registered at each point during transmission. They stopsending, and prepare to retransmit once the carrier is sensed to be clear again,and after the backoff time has expired.We will assume for the purposes of this simulation, that the backoff timerstarts immediately after the first detection of collision. Ideally this timershould be set in units of 12T, the round trip time for the network. In thiscase, the backoff values given are not realistic, but allow us to shorten thelength of the simulation.

At time t=7T A B CA backoff 1/2 CS=Y CS=Y CS=YC backoff 1/1 CD=Y CD=Y CD=Y

C retries, fails Sending:1,0,1,0,1,0 Sending:1,1,0,0,1,1C backs off. 1,0,1,0,1,0 0,0,1,1,0,0

• ∗1C← ∗ 0A→

0C←

∗ 1A→

0C←

∗ 0A→

1C←

∗ 1A→

1C←

∗0A→ •

Rather than C backing off to the next level at this point, it should just waituntil the carrier is clear, and start retransmitting. We will instead assume(incorrectly) that C will backoff to the next level.

At time t=8T A B CA backoff 2/2 CS=Y CS=Y CS=Y

A retries, fails CD=Y CD=Y CD=YA backs off. Sending:1,0,1,0,1,0 Sending: 1,1,0,0,1,1

C backoff 1/3 1,0,1,0,1,0 0,0,1,1,0,0• ∗0C← ∗0C← ∗ 0A→

1C←

∗ 1A→

1C←

∗0A→ ∗1A→ •

Page 72: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

72 APPENDIX A. SOLUTIONS

At time t=9T A B CA backoff 1/7 CS=Y CS=Y CS=YC backoff 2/3 CD=Y CD=Y CD=Y

Sending:1,0,1,0,1,0 Sending: 1,1,0,0,1,11,0,1,0,1,0 0,0,1,1,0,0

• ∗0C← ∗0C← ∗ 0A→

1C←

∗ 1A→

1C←

∗0A→ ∗1A→ •

At time t=10T A B CA backoff 2/7 CS=Y CS=Y CS=YC backoff 3/3 CD=Y CD=Y CD=Y

C retries, fails Sending:1,0,1,0,1,0 Sending: 1,1,0,0,1,1C backs off. 1,0,1,0,1,0 0,0,1,1,0,0

• ∗0C← ∗1C← ∗1C← ∗0A→ ∗1A→ ∗0A→ •

At time t=11T A B CA backoff 3/7 CS=Y CS=N CS=Y

C backoff 1/13 CD=Y CD=N CD=YSending:1,0,1,0,1,0 Sending: 1,1,0,0,1,1

1,0,1,0,1,0 0,0,1,1,0,0• ∗1C← ∗1C← ∗0A→ ∗1A→ •

At time t=12T A B CA backoff 4/7 CS=Y CS=N CS=Y

C backoff 2/13 CD=Y CD=N CD=YSending:1,0,1,0,1,0 Sending: 1,1,0,0,1,1

1,0,1,0,1,0 0,0,1,1,0,0• ∗1C← ∗0A→ •

At time t=12T A B CA backoff 5/7 CS=N CS=N CS=N

C backoff 3/13 CD=N CD=N CD=NSending:1,0,1,0,1,0 Sending: 1,1,0,0,1,1

1,0,1,0,1,0 0,0,1,1,0,0• •

At time t=13T A B CA backoff 6/7 CS=N CS=N CS=N

C backoff 4/13 CD=N CD=N CD=NSending:1,0,1,0,1,0 Sending: 1,1,0,0,1,1

1,0,1,0,1,0 0,0,1,1,0,0• •

Page 73: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.4. SOLUTIONS TO EXERCISES: SECTION 4.1 73

At time t=13T A B CA backoff 7/7 CS=N CS=N CS=N

A retries CD=N CD=N CD=Ncarrier free at A Sending:1,0,1,0,1,0 Sending: 1,1,0,0,1,1C backoff 4/13 1,0,1,0,1,0 0,0,1,1,0,0

• •

At time t=14T A B CC backoff 5/13 CS=Y CS=N CS=N

CD=N CD=N CD=NSending:0,1,0,1,0 Sending: 1,1,0,0,1,1

1,0,1,0,1,0 0,0,1,1,0,0• 1A→ •

At time t=15T A B CC backoff 6/13 CS=Y CS=N CS=N

CD=N CD=N CD=NSending:1,0,1,0 Sending: 1,1,0,0,1,1

1,0,1,0,1,0 0,0,1,1,0,0• 0A→ 1A→ •

At time t=16T A B CC backoff 7/13 CS=Y CS=Y CS=N

CD=N CD=N CD=NSending:1,0 Sending: 1,1,0,0,1,11,0,1,0,1,0 0,0,1,1,0,0• 1A→ 0A→ 1A→ •

At time t=17T A B CC backoff 8/13 CS=Y CS=Y CS=N

CD=N CD=N CD=NSending:1,0 Sending: 1,1,0,0,1,11,0,1,0,1,0 0,0,1,1,0,0• 0A→ 1A→ 0A→ 1A→ •

At time t=18T A B CC backoff 9/13 CS=Y CS=Y CS=N

CD=N CD=N CD=NSending:0 Sending: 1,1,0,0,1,11,0,1,0,1,0 0,0,1,1,0,0• 1A→ 0A→ 1A→ 0A→ 1A→ •

At time t=19T A B CC backoff 10/13 CS=Y CS=Y CS=Y

CD=N CD=N CD=NSending: Sending: 1,1,0,0,1,1

1,0,1,0,1,0 0,0,1,1,0,0• 0A→ 1A→ 0A→ 1A→ 0A→ 1A→ •

Page 74: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

74 APPENDIX A. SOLUTIONS

At time t=20T A B CC backoff 11/13 CS=Y CS=Y CS=Y

CD=N CD=N CD=NSending: Sending: 1,1,0,0,1,10,1,0,1,0 0,0,1,1,0,0• 1A→ 0A→ 1A→ 0A→ 1A→ 0A→ •

At time t=21T A B CC backoff 12/13 CS=Y CS=Y CS=Y

CD=N CD=N CD=NSending: Sending: 1,1,0,0,1,11,0,1,0 0,0,1,1,0,0• 0A→ 1A→ 0A→ 1A→ 0A→ 1A→ •

At time t=22T A B CC backoff 13/13 CS=Y CS=Y CS=Y

C retries CD=N CD=N CD=NC waits for Sending: Sending: 1,1,0,0,1,1

carrier 0,1,0 0,0,1,1,0,0• 1A→ 0A→ 1A→ 0A→ 1A→ 0A→ •

Here we have changed the rules again. Instead of C backing off still further,we will give it the correct behaviour of waiting until the carrier is free, andthen starting to transmit.

At time t=23T A B CC backoff 13/13 CS=Y CS=Y CS=Y

C retries CD=N CD=N CD=NC waits for Sending: Sending: 1,1,0,0,1,1

carrier 1,0 0,0,1,1,0,0• 0A→ 1A→ 0A→ 1A→ 0A→ 1A→ •

At time t=24T A B CCS=Y CS=Y CS=YCD=N CD=N CD=N

C waits for Sending: Sending: 1,1,0,0,1,1carrier 0 0,0,1,1,0,0

• 1A→ 0A→ 1A→ 0A→ 1A→ 0A→ •

At time t=25T A B CCS=Y CS=Y CS=YCD=N CD=N CD=N

C waits for Sending: Sending: 1,1,0,0,1,1carrier 0,0,1,1,0,0

• 0A→ 1A→ 0A→ 1A→ 0A→ 1A→ •

Page 75: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.4. SOLUTIONS TO EXERCISES: SECTION 4.1 75

At time t=26T A B CCS=N CS=Y CS=YCD=N CD=N CD=N

C waits for Sending: Sending: 1,1,0,0,1,1carrier 0,0,1,1,0,0

• 0A→ 1A→ 0A→ 1A→ 0A→ •

At time t=27T A B CCS=N CS=Y CS=YCD=N CD=N CD=N

C waits for Sending: Sending: 1,1,0,0,1,1carrier 0,0,1,1,0,0

• 0A→ 1A→ 0A→ 1A→ •

At time t=28T A B CCS=N CS=Y CS=YCD=N CD=N CD=N

C waits for Sending: Sending: 1,1,0,0,1,1carrier 0,0,1,1,0,0

• 0A→ 1A→ 0A→ •

At time t=29T A B CCS=N CS=N CS=YCD=N CD=N CD=N

C waits for Sending: Sending: 1,1,0,0,1,1carrier 0,0,1,1,0,0

• 0A→ 1A→ •

At time t=30T A B CCS=N CS=N CS=YCD=N CD=N CD=N

C waits for Sending: Sending: 1,1,0,0,1,1carrier 0,0,1,1,0,0

• 0A→ •

At time t=31T A B CCS=N CS=N CS=NCD=N CD=N CD=N

C waits for Sending: Sending: 1,1,0,0,1,1carrier 0,0,1,1,0,0

• •

Station C can now transmit its packet.

Page 76: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

76 APPENDIX A. SOLUTIONS

At time t=31T A B CCS=N CS=N CS=YCD=N CD=N CD=N

C waits for Sending: Sending: 1,0,0,1,1carrier 0,0,1,1,0,0

• ← 1C •

C continues to successfully relay its packet down the line.

4. Packet 1: Broadcast packet from warthog, Novell, (length 40).Packet 2: Broadcast packet from ed205, length 37 bytes, NETBEUIMulticast packet from a Synoptics hub (to discover others), length 19.

5. Why are problems on an Ethernet network difficult to trace?It is a shared medium, and so damage to any part of the medium will affect the entirenetwork, making it difficult to identify the source. Many problems are traffic related,and so dividing the network removes the problem, without pinpointing the source.

6. Assume we decided to discard the current Ethernet specification for “Starlan” whichruns at 1Mbps. How would this affect:

(a) Round trip time:(b) Minimum packet size.(c) Maximum length of cable.

The round trip time is part of the specification. This is unaffected by transmission rate.If we assume this is still 50µs, then maximum cable length is unchanged. The minimumpacket size requires a packet big enough for transmission to still continue for an entireround trip. Number of bits = 1×106

×50×10−6=50 bits ~ 6 bytes minimum packet size.

7. Two stations on standard 10Mbps Ethernet are 200m apart. Both transmit 64 bytes,station A starting at time 0s, and station B starting at time 0.5 microseconds. Assumethe signal propagates at 2× 108m/s.

(a) When and where do the packets collide.Assume packet from B has been travelling for x seconds. Then they meet when thepackets together have covered 200 meters.

2× 108(2x + 0.5× 10−6) = 200

2x + 0.5× 10−6 = 1× 10−6

x = 0.25× 10−6

They collide when A has travelled for 0.75 microseconds, and B for 0.25 microsec-onds. Distance from A = 2× 108

× 0.75× 10−6 = 150m from A.(b) How many bits has station A sent before it detects the collision.

Packet must travel to collision, and back to A before A is aware of the collision.Number of bits sent in this time is: 10× 106

× 1.5× 10−6 = 15 bits.(c) How many bits has station B sent before it detects the collision.

5 bits.(d) Which station is likely to begin retransmitting first.

Since they both backoff for a random amount of time, no definite answer can begiven. B receives the collision first, and starts waiting first, so is more likely toretransmit first.

Page 77: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.4. SOLUTIONS TO EXERCISES: SECTION 4.1 77

8. Compare the access methods that use CSMA/CD to those that use token passing. Whatare the advantages and disadvantages of each?Collision detection is non-deterministic, making it difficult to predict and achieve to-tal bandwidth utilization. Token passing can make use of all available bandwidth.CSMA/CD is used in Ethernet, which is better established and used than token ring.

9. What are the advantages and disadvantages of token-ring networking?It was developed as an IBM technology. Although Token Ring technology is now offeredby great many vendors, many in the user community perceive it as proprietary. Eth-ernet is simple, reliable, and effective for the majority of networks, and at the sametime, cost significantly less than Token Ring. TCP/IP has traditionally been wed toEthernet. Growing industry demand for TCP/IP has accompanied a recent surge in theEthernet popularity. Nevertheless, Token Ring is an effective physical layer technologywith features that make it preferable under some circumstances.

10. Compare the response of token ring and FDDI to:

(a) An attached station being run over by a bulldozer.Token ring: MAU disconnects station and repairs ring. FDDI: Concentrator dis-connects station and repairs ring.

(b) A back-hoe amputating the cable running to an attached station.Token ring: MAU disconnects station and repairs ring. FDDI: Primary and sec-ondary rings wrap to produce single ring.

11. Interpret the following Ethernet frames. Identify the source and destination address,and the field containing type/length of data encapsulated in the packet.Answer:

• Packet 1: Destination: FF FF FF FF FF FF, Source 00 E0 29 0F EC AD, Type 0800 (Ethernet II - DIX)

• Packet 2: Destination: 03 00 00 00 00 01, Source 00 00 C0 C3 ED D2, Length 00A6 (802.3)

• Packet 3: Destination: FF FF FF FF FF FF, Source, 00 E0 29 44 21 1B, Type 81 37(Ethernet II - DIX)

12. What effect will the introduction of 100Mbps and 1Gbps transmission have on the limitsof Ethernet cable length, and packet size?100Mbps Ethernet reduces the round trip time to 5µs. If we assume the trend contin-ues, then the round trip time of 1Gbps Ethernet is 0.5µs.We can now calculate minimum packet size (so as to still be transmitting after a com-plete round trip), and maximum width of the network (so collisions return with 1 roundtrip).

100Mbps: Minimum packet size: 100Mbps×5µs = 500bits ' 64bytes. Maximum Width:c(2× 108m/s)× 5µs× 1

2 = 500m.

1Gbps: Minimum packet size: 1Gbps × 0.5µs = 500bits ' 64bytes. Maximum Width:c(2× 108m/s)× 0.5µs× 1

2 = 50m.

It looks like 1Gbps Ethernet will have to use a mechanism other than CSMA/CD.

13. Identify the Ethernet frame type (the type of Ethernet header) being used by the fol-lowing packets (assume these are Ethernet packets with preamble already removed).Show any workings.

Page 78: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

78 APPENDIX A. SOLUTIONS

(a) Packet 1: 00 E0 29 47 89 33 00 00 C0 54 9E B8 08 00 45 00 03 4E 0E C5(b) Packet 2: 00 E0 29 0F EC AD 00 00 C0 BE 74 A7 81 37 FF FF 00 30 00 04 00(c) Packet 3: 01 80 C2 00 00 00 00 E0 1E E0 BF 00 00 26 42 42 03 00 00 00 00 00 80

00 00 00

14. Explain the conditions under which a Late Collision would occur on an Ethernet net-work.

15. Explain the acronym: CSMA/CD, and describe how Ethernet controls access to theshared medium when stations transmit a packet (a state transition diagram can beused for the latter part of this question).

16. Complete the following table, comparing the characteristics of Ethernet, Token Ringand FDDI:

Logical Topology Physical Topology LAN/MAN/WAN Multiplexing strategyEthernet

Token RingFDDI

17. Gigabit Ethernet uses the same maximum and minimum frame sizes as 10Mbps Eth-ernet. It runs on category 5 cable rated up to 125Mbps, previously used for 100MbpsEthernet. Explain how it achieves these feats without breaking the CSMA/CD protocol,or any physical laws.

18. Which node on an Ethernet network controls access to the transmission medium?There is no node on an Ethernet network which controls who can access the network.Every node is capable of deciding for itself.

19. Can data be lost on an Ethernet network, and if so, under what conditions?Yes. If a packet is retransmitted 16 times, and each attempt results in a collision, thenthe packet will be discarded. If the packet is sent, and receiver is not listening, thenthe data is lost.

20. An Ethernet network experiences a collision. Is the network faulty?No, collisions are normal events on Ethernet networks.

21. What happens if the network cable is unplugged from the machine while transmitting?For physical bus: Card detects reflections from unterminated cable and discards packetafter 16 retries. For physical star: Card does not detect any collisions and considers thepacket successfully sent.

22. What is the maximum distance between two points on a single Ethernet collision do-main, using 10Base5?At most 5 repeated segments, at 500m per segment = 2.5km.

23. Suppose the specified round trip time for Ethernet was doubled. What effect would thathave on minimum packet size and network diameter?Longer round trip time means packets must be transmitted for longer, so double min-imum packet size. Response needs to traverse network within round trip time, so net-work can grow.

Page 79: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.4. SOLUTIONS TO EXERCISES: SECTION 4.1 79

24. Suppose we use 100Mbps Ethernet. How would that affect minimum packet size andnetwork diameter?If we retain the round trip time, then minimum packet sizes would have to grow, or thenetwork shrink. In practice, minimum packet size is set, so round trip time decreasesand so does network size.

25. Suppose machines A and B are 1 m apart, and on the same (repeated) segment asmachine C, which is 10km away. A sends a 64 byte packet to B. Just before the packetreaches C, C starts transmitting.

(a) Does B receive the packet from A?(b) Does C receive the packet from A?(c) Does A retransmit the packet?

B receives the packet. A finishes transmitting. It collides just before C, so C doesn’treceive it. A may see the collision, but won’t retransmit.

26. Suggest potential points of failure for:

(a) An Ethernet network(b) A Token Ring network.

Ethernet fails if the cable is broken for a physical bus, or if the central node (hub,switch) fails for a physical star. For a physical star, a cable break isolates only a singlemachine. It is vulnerable to a faulty machine broadcasting continuously.Token ring is vulnerable to loss of central MAU for physical star, or to a cable break forphysical ring. Cable break to an individual machine for a physical star will only isolatethat machine, but may cause loss of token, sending machine or monitor which requirescorrective action, but should not kill the network.

27. What would be the equivalent of a switch on a Token Ring network?Switches allow point to point connections on Ethernet networks when required (whenpackets are not broadcast). We can imagine a similar direct connection system forToken Ring for sending packets. The token would still have to pass sequentially frommachine to machine.

28. Can a Token Ring network support broadcasting?Since every packet passes through each machine, it should be possible.

29. In which ways would FDDI be a better LAN backbone technology than Gigabit Ether-net?FDDI can go long distance, and offers greater resistance to cable failure.

30. Does ISDN use circuit switching or packet switching?Users dial-up an ISDN connection so it provides a circuit between two end points. Thiscircuit is carried over a 3rd party digital network, so they would be virtual circuitscarried over a packet switched network. The ISDN S/T bus would be packet based tomultiplex the different devices. Thus: packets over virtual circuits over packets.

31. Category 5 twisted pair cable can transmit 100Mbps over 100m before signal attenua-tion becomes a problem. What rate do you think would be possible with Telkom’s coppertelephone cable (running over about 5km)?With ADSL, up to 6-8 Mbps.

Page 80: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

80 APPENDIX A. SOLUTIONS

32. What is better:

(a) fixed size packets or variable sized packets?(b) big packets or small packets?(c) sending each packet the same way, or routing each packet down the least congested

link?

Fixed sized packets don’t have to send length in the header. Space may be wastedin padding. Big packets minimize header overhead, but cause other smaller packetsqueued behind to wait longer. Routing each packet the same way solves reorderingproblems but may cause congestion. Routing each packet via the least congested linkmay improve network throughput, or just defer the problem to a later congested link.Known routes can negotiate quality of service.

33. What is the percentage header overhead for:

(a) An ATM cell(b) A TCP/IP/Ethernet packet with a payload of 10 bytes.(c) A UDP/IP/Ethernet packet with a payload of 1400 bytes.

Header overheads:

(a) ATM = 5/53 = 9.4%.(b) TCP=(20+20+14/20+20+14+10)=84%.(c) UDP=(8+20+14/8+20+14+1400)=2.9%.

34. How long would it take to transmit an ATM cell on a 622 Mbps network?53 bytes=424 bits. Time taken = 424b/622Mbps=0.68µs.

35. How long would the same cell take to travel from Cape Town to New York (~70000kmvia satellite)?Time taken to travel 70000km at the speed of light = 70000000m/300000000mps =0.233s.

36. How many cells are in transit at any time?Number of packets in transit = 0.233s/0.68µs=342000.

37. What mechanism does Ethernet use for:

(a) Signalling (NRZ, RZ, Manchester).(b) Error correction.

Manchester encoding. A 32 bit CRC is used for error detection.

38. If two stations start transmitting at opposite ends of the network at the same time,what happens to the number of bits they can transmit before collision is detected if:

(a) Cable length increases.(b) Transmission rate increases.

Number of bits sent increases in both cases.

Page 81: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.4. SOLUTIONS TO EXERCISES: SECTION 4.1 81

39. Under what circumstances will data be lost on an Ethernet network.If more that 16 collisions occurs for a single transmission attempt. If it fails a CRCcheck on receipt. If the receiving station is not listening. If the packet collides aftertransmission is complete.

40. An Ethernet node successfully transmits a packet. Does Ethernet guarantee that it willbe received correctly?No. Only that no collision was detected before the transmission completed.

41. Does Ethernet and CSMA/CD address flow control issues? What happens to an Ether-net network as the number of machines wanting to transmit increases?The backoff with increasing delays attempts to reduce traffic levels when (it is assumed)congestion causes loading on the network. As the number of machines increases, morecollisions are likely and the effective bandwidth decreases.This depends on traffic patterns. A client-server environment is likely to self regulateto a large extent by the order in which packets are sent due to the restrictions at highernetwork layers (clients must wait for reply from server before sending another request).

42. Suppose we keep the 50µs round trip time for 100Mbps, 1Gbps and 10Gbps Ethernet.What are the implications in terms of minimum packet size and network diameter?Packet size would increase - we would be able to send more bits in the same amount oftime. Network diameter would remain constant - depends only on round trip time andspeed of light.

43. Here are some Ethernet addresses. What can we tell about the quality of the equip-ment?

• 00:04:DC:5C:1E:01 (00:04:DC = Nortel)• 01:00:81:00:01:00 (Bay Networks Autodiscovery)• 00:00:C0:AB:23:24 (00:00:C0 = Western Digital)• 00:E0:29:47:89:E3 (00:E0:29 = SMC)

Bay Networks has been taken over by Nortel, and Western Digital became SMC. Thusthese devices are probably older.

44. A router can add a significant delay to an Ethernet packet. Does this affect the calcu-lation of network size, based on round trip time restrictions?No, routers remove the packet from one collision domain and put it into another. Theround trip time only affects the nodes inside a single collision domain.

45. Both IP and IPX (and other protocols) can be encapsulated inside an Ethernet packet.How does the receiver of an Ethernet packet know which protocol to pass the payloadto, while de-encapsulating the packet?There must be a type field stored in the Ethernet header somewhere.

46. What happens to CSMA/CD in a switched environment?Having a dedicated link means that collision detection need not take place. In addition,full duplex is possible, both parties can send at the same time (each using one line inthe twisted pair). If there is contention for a link, the switch will buffer packets andsend them sequentially.

Page 82: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

82 APPENDIX A. SOLUTIONS

47. Why did Novell have to lose the checksum field in their Ethernet header?The checksum field overlaps with the DSAP/SSAP fields of the 802.2 header. Since thechecksum could be any possible value, it may produce some valid DSAP/SSAP combina-tion. This would complicate passing the data to the appropriate network layer protocol.

48. Ethernet chooses to keep the minimum packet size fixed for each rate variant. Whatdoes this imply for 1Gbps Ethernet in terms of network limits.With minimum packet size fixed, round-trip time decreases with increase in rate, andnetwork diameter decreases. Thus 1Gbps Ethernet has a radius of 50m.

49. The broken ends of the cable in a physical bus act a mirrors for the signal, and causereflection, which scrambles the signal in the entire cable. The hub in a physical starcan isolate broken links, and allow the remainder of the network to continue to com-municate.

50. All are logical buses, and all traffic is broadcast. Only that addressed to the broadcastaddress should be picked up by every node on the network.

51. All can unicast, by labeled the packet with the address of the destination node. Thisshould be the only node that retrieves the payload of the packet, regardless of the factthat other stations have the potential for doing so.

52. Bits would get shorter, allowing more of the packet to be on the wire when collisionsoccur. A station could even finishing sending the packet before a collision was noticed.

53. It can’t. All it can do, is try to ensure that the packet is transmitted safely. This relieson the network being wired up within specification.

54. A tree topology occurs when several hubs are linked to a backbone hub. Networkstopologies containing cycles should be avoided because these are not compatible with acollision detection approach.

55. In a sense, the more traffic that is sent on the network, the more collisions which slowsdown the effective transmission rate. This is not a very nice flow control mechanism, iteffectively reduces the capacity of the channel when the demand increases. The natureof the traffic patterns would also play a role: 100 machines wanting to communicatewith any other machines would have a very different effect to 100 machines all wantingto talk to a single server.

56. Use separate collision domains. One machine receives the packet, and sends it out ontoanother network, performing all the CSMA/CD steps all over again. Collisions on onenetwork are irrelevant to the other network, and so distance limitations based on timeto see a collision are irrelevant.

57. The size is kept small enough to allow all parties a fair chance at utilizing the network.Also above about 12000 bytes, a 32 bit CRC becomes less effective.

58. The local address is physically built into the network card.

59. No, a field could have a length value, which defines how many of the bytes followingare part of the field.

60. It avoided making minimum packet size larger to avoid wasting bandwidth when send-ing small packets. Gigabit Ethernet could not avoid increasing minimum packet size,but uses bursting to try to limit the wastage.

61. In case they are used on data-link protocols that do not have error detection.

Page 83: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.5. SOLUTIONS TO EXERCISES: SECTION 5.1 83

62. Broadcast a request, using some other known characteristic of the station to identify it.

63. Too small packet, too large packet, bad CRC, cable break.

64. Fiber offers longer unrepeated runs, more noise immunity and less chance of snoopingthe electromagnetic radiation. Copper cabling is simpler to install.

65. The LAN backbone may need to connect geographically dispersed subnetworks, andmay not need to handle large amounts of traffic between subnetworks (most traffic maybe confined to the subnetwork).

66. Yes. The original intention of a layered network architecture is to allow one protocolto be removed at any layer and substituted with another that performs an equivalentfunction.

67. Token travels at 2× 108m/s and covers 100m. Time taken is 1002×108 = 5× 10−7s. Thus

0.5µs. At 16Mbps a 100 byte packet takes 100∗816×106 = 5× 10−5s. Thus overhead is about 1%

of the time to transmit such a packet.

68. Ethernet uses delays (backoff) for random periods. It is difficult to work out when datawill actually be sent. Token Ring is deterministic and more predictable.

69. It sends out a packet to itself, and checks to see if it comes back with the addressrecognised bit set.

70. Bridges, routers.

71. Use switches rather than hubs.

A.5 Solutions to exercises: Section 5.11. Layers:

(a) Ethernet header: From monza.cs to snert.cs, type 0800, encapsulates an IP packet.(b) IP Header: From 146.231.26.135 to 146.231.25.35 (also monza.cs to snert.cs), header

length is 5 32 bit words = 20 bytes (no options). Protocol is 6 (TCP), so encapsulatesa TCP packet.

(c) TCP Header: Source port 23 (Telnet port) to destination port 10315. Containstelnet data.

(d) First line of data if converted as ASCII reads: Found network.

2. HTTP uses TCP as its transport layer. Why?TCP provides a virtual channel which handles sequencing, acknowledgments, fragmen-tation, multiplexing and error checking issues leaving HTTP to concentrate on client-server specific issues. Since most HTTP is run over the Internet, the facilities of TCPare required, as is a protocol commonly used on the Internet.

3. Consider a client-server fractal computing and rendering system, running over Ether-net. You have a choice of using UDP or TCP as the transport layer. Performance is anissue. Which protocol would you choose, and why?TCP specifies its own timeouts, and retransmissions. This functionality must be pro-vided for by UDP. To optimize performance, one must have control over these issues.Using UDP provides multiplexing, and error checking, but allows the user to definetheir own sequencing and timing with their own higher level protocol.

Page 84: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

84 APPENDIX A. SOLUTIONS

4. Suppose one wanted to run TCP over UDP over IP. What changes would you make tothese protocols, and how would that affect the structure of the headers?TCP and UDP both use port numbers, and some form of error checking. This func-tionality could be removed from the TCP header (at the cost of changing the protocolspecification). Alternatively, everything could be left as defined in the specifications,and TCP packets could be encapsulated inside UDP packets, which would be encapsu-lated inside IP packets.

5. Explain how TCP/IP communications work. Why has this protocol been important tothe Internet?TCP provides communications by controlling data flow with nodes agreeing on a win-dow for data transmission. The transmission window is often adjusted to account fornetwork traffic. TCP breaks streams of data into datagrams. Sequence numbers en-sure datagrams are arranged in the right sequence. IP handles addressing, packetrouting, and error checking. TCP/IP is the language of the Internet, providing reliablecommunications between nodes, and a history of being strongly established at college,university, and government installations.

6. Why are port numbers used in UDP and TCP. What is the significance of the variousvalues used as port numbers.They are used to multiplex multiple data streams to a single machine. They effectivelycreate new addresses on the network, composed of machine name and port numberwhich can be used to identify services and connection.

7. What is the format of a URL to a web server which is not using the default port address?

http://server:port/location, for example:http://cs.ru.ac.za:2600/mypage.html

8. Why are octet arrays used to specify TCP and UCP headers as opposed to ASN.1?Answer: Octet arrays work well for headers that have a constant unchanging struc-ture, such as those for UDP and TCP. ASN.1 supports the encoding of the type of thestructure, as well as the data values for each field, so is better used where the protocolheader varies for each message (see SMNP).

9. Identify the layers of the OSI model corresponding to UDP and TCP. Explain how theseprotocols satisfy the requirements of these layers?

• 5: Session: Sequencing - TCP• 4: Transport: Connection establishment, Connection termination, Lost and dupli-

cate packets. - TCP• 3: Network: Addressing, Flow control - TCP and UDP• 2: Data Link: Reliability (Both TCP and UDP provide checksums, but are not

usually considered as operating at this layer).

10. Why does IP, which runs over Ethernet, create its own type of addresses and not usethe addressing provided by the Ethernet layer.Answer: IP addresses represent the logical structure of the network, and so the ad-dress provides an indication of the position of the node in the network. This simplifiesrouting. Ethernet addresses are assigned by the card manufacturer, and so there isno correspondence between address and where the node is likely to be found on thenetwork. Addressing in large networks is no longer dependent on only one data linkprotocol.

Page 85: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.5. SOLUTIONS TO EXERCISES: SECTION 5.1 85

11. For TCP, explain the process of:

(a) connection creation(From the TCP RFC) For each connection there is a send sequence number and areceive sequence number. The initial send sequence number (ISS) is chosen by thedata sending TCP, and the initial receive sequence number (IRS) is learned duringthe connection establishing procedure.For a connection to be established or initialized, the two TCPs must synchronize oneach other’s initial sequence numbers. This is done in an exchange of connectionestablishing segments carrying a control bit called "SYN" (for synchronize) and theinitial sequence numbers. As a shorthand, segments carrying the SYN bit are alsocalled "SYNs". Hence, the solution requires a suitable mechanism for picking aninitial sequence number and a slightly involved handshake to exchange the ISN’s.The synchronization requires each side to send it’s own initial sequence numberand to receive a confirmation of it in acknowledgment from the other side. Eachside must also receive the other side’s initial sequence number and send a confirm-ing acknowledgment.

i. A –> B SYN my sequence number is Xii. A <– B ACK your sequence number is X, SYN my sequence number is Y

iii. A –> B ACK your sequence number is YBecause steps 2 and 3 can be combined in a single message this is called the threeway (or three message) handshake.A three way handshake is necessary because sequence numbers are not tied to aglobal clock in the network, and TCPs may have different mechanisms for pick-ing the ISN’s. The receiver of the first SYN has no way of knowing whether thesegment was an old delayed one or not, unless it remembers the last sequencenumber used on the connection (which is not always possible), and so it must askthe sender to verify this SYN.

(b) sequencingThe TCP must recover from data that is damaged, lost, duplicated, or deliveredout of order by the internet communication system. This is achieved by assigninga sequence number to each octet transmitted, and requiring a positive acknowl-edgment (ACK) from the receiving TCP.Transmission is made reliable via the use of sequence numbers and acknowledg-ments. Conceptually, each octet of data is assigned a sequence number. The se-quence number of the first octet of data in a segment is transmitted with thatsegment and is called the segment sequence number. Segments also carry an ac-knowledgment number which is the sequence number of the next expected dataoctet of transmissions in the reverse direction. When the TCP transmits a seg-ment containing data, it puts a copy on a retransmission queue and starts a timer;when the acknowledgment for that data is received, the segment is deleted fromthe queue. If the acknowledgment is not received before the timer runs out, thesegment is retransmitted.An acknowledgment by TCP does not guarantee that the data has been deliveredto the end user, but only that the receiving TCP has taken the responsibility to doso.

(c) dealing with lost packetsIf the ACK is not received within a timeout interval, the data is retransmitted.At the receiver, the sequence numbers are used to correctly order segments thatmay be received out of order and to eliminate duplicates. Damage is handled byadding a checksum to each segment transmitted, checking it at the receiver, anddiscarding damaged segments.

Page 86: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

86 APPENDIX A. SOLUTIONS

(d) flow controlTCP provides a means for the receiver to govern the amount of data sent by thesender. This is achieved by returning a "window" with every ACK indicating arange of acceptable sequence numbers beyond the last segment successfully re-ceived. The window indicates an allowed number of octets that the sender maytransmit before receiving further permission.

(e) connection terminationThe notion of closing a full-duplex connection is subject to ambiguous interpreta-tion, of course, since it may not be obvious how to treat the receiving side of theconnection. The user who closes may continue to receive until he is told that theother side has closed also. Thus, a program could initiate several sends followedby a close, and then continue to receive until signaled that a receive failed becausethe other side has closed. We assume that the TCP will signal a user, even if noreceives are outstanding, that the other side has closed, so the user can terminatehis side gracefully. A TCP will reliably deliver all buffers sent before the connec-tion was closed so a user who expects no data in return need only wait to hear theconnection was closed successfully to know that all his data was received at thedestination TCP. Users must keep reading connections they close for sending untilthe TCP says no more data.FIN segments are exchanged. When all segments preceding the FINs have beenprocessed and acknowledged, each TCP can ACK the FIN it has received. Bothwill, upon receiving these ACKs, delete the connection.

12. Suggest a way in which UDP could be introduced into a client/proxy/server HTTP sit-uation without changing either clients or servers. What potential advantages couldresult?

13. Some new Internet based protocols are layering themselves above UDP rather TCP.Suggest reasons as to why they would have made this choice.

14. Two machines are communicating. One is switched off, and on again. What effect wouldthis have on communication using:

(a) UDP(b) TCP

For TCP the connection would be broken when the machine started again, detected apacket destined for an unknown connection and sent a reset. For UDP, data wouldbe lost, but communication could continue, unless some timeout mechanism had beenemployed at a higher level.

15. Ethernet is capable of broadcasting packets. Which of the following protocols are alsocapable of using broadcast?

(a) IP(b) TCP(c) UDP

IP and UDP can use broadcast, but connection oriented TCP is point to point.

16. Would a server listening for UDP packets on port 80 receive TCP packets directed tothat port?No, the different protocols serve as a demultiplexing field. So udp/80 is distinct fromtcp/80.

Page 87: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.5. SOLUTIONS TO EXERCISES: SECTION 5.1 87

17. Why are port numbers restricted to the range [0-65535]?Port numbers are stored in a 2 byte field in the header.

18. What is the largest IP packet that can be sent, and what happens if it is sent overEthernet?The total length field is 2 bytes, giving a bound of about 65kB. It would have to befragmented to fit the 1500 bytes MTU of Ethernet.

19. Flow control should be invoked when the network is congested. How can TCP deter-mine if this is the case?Lost packets mean that acknowledgements do not return, meaning that further pack-ets cannot be sent until these are successfully retransmitted. Thus lost packets areassumed to be the result of congestion.

20. What other mechanism can TCP employ for flow control?The retransmission timeout is adapted to the round trip time for a packet and its ac-knowledgement. Thus for slow networks, this will be a larger value.

21. Why do TCP and UDP packets need to specify both source and destination ports?TCP connections are uniquely identified by the address and port of both parties - multi-ple clients can connect to the single service port of a server machine. The source valuesallow replies to be sent back, without having to put return IP:port addresses in otherprotocol layers.

22. IPX and IP are both network layer protocols. Why do we not find any IPX packets onthe Internet?Internet routers route only IP packets, using the header format and address structurespecified by the Internet Protocol. They are IP routers. IPX routers are required toroute IPX packets.

23. Can broadcast packets be sent on a Token Ring network?Yes, broadcast and multicast are supported. The first bit of the address indicateswhether it is a group address, or an address of an individual station. A broadcastaddress of FF:FF:FF:FF:FF:FF is supported.

24. Is it feasible to connect a Token Ring and an Ethernet LAN: specifically are the ad-dresses compatible?Feasible yes, both use 6 byte MAC addresses. Both use broadcast media, so a bridge onthe network could pick up packets and pass them on to the other network if required.There is a small possibility that an Ethernet card and a Token Ring card may have thesame address. Routers would get around this problem, but would require a routableprotocol at the network layer.

25. Which is a better device to use for connecting a Token Ring and an Ethernet LAN: abridge or a router?A bridge is better if no routable protocol is above the data link layer (such as Microsoft’sNETBEUI which has no addresses at the network layer). A router is a good generalsolution for connecting different Data Link technologies.

26. What is the future for Token Ring?100Mbps and 1Gbps versions are being produced. The 100Mbps standard is out (1998).It is regarded as the second most popular networking technology (IEEE 802.5).

Page 88: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

88 APPENDIX A. SOLUTIONS

27. Given that a Token Ring network needs to see a token every 10ms, what limitationwould that impose on the size of the network?The diameter of the network must allow the token to circulate in that time. Thus2 × 108m/s × 10 × 10−3s= 2 × 106m. A diameter of 2000km is unlikely to be a severerestriction.

28. What fields are required in the frame of a Token Ring token?Only the start and end frame delimiters, and the Access Control field (to indicate thatit is a token). Discard Frame Control, addresses, data, CRC and Frame Status.

29. How many stations could be placed on an FDDI network if the maximum distance of2km between stations is used?Diameter of 100km, thus 50 stations.

30. FDDI uses a signalling mechanism called NRZ-I, which inverts the signal for every 1bit. Encode the sequence 00001111 using NRZ-I.

0 0 0 0 1 1 1 1

31. FDDI recodes every group of 4 bits as a 5 bit sequence with no more than 3 consecutive0s. Why?Using NRZ-I, bursts of 1s encodes the clock signal nicely, but bursts of 0s does not.Thus FDDI limits bursts of zeros.

32. What is the benefit of using ADSL over PRI ISDN?ADSL requires only one pair of copper conductors. ADSL has a downstream capacityup to about 8Mbps, exceeding the 2Mbps available under the PRI.

33. Americans can get a T1 Internet connection which runs at 1.544Mbps. Europeanswould get an E1 connection, at 2.048Mbps. How is this related to ISDN services?The American version of PRI uses 23 B channels, giving about 1.5Mbps. The Europeanstandard uses 30 B channels, giving about 2Mbps.

34. Would real-time multimedia traffic prefer fixed size, or variable size packets?Fixed size packets make it easier to predict how long each will take, simplifying calcu-lations about the quality of service that can be received.

35. In what circumstances would fixed path routing be preferable to routing down the leastcongested link?Fixed path routing is useful sequence is important, even if reliability is not - for examplewith audio and video streams. Occasional glitches are acceptable, but mis-ordering isnot.

36. How can we use 100BaseT for Gigabit Ethernet?Use all 4 pairs with 4 signal levels (2 bits encoded at once): 4 * 2 * 125Mbps.

37. Ethernet uses Ethernet/hardware/MAC address, IP uses IP addresses, TCP and UDPuse port numbers to extend the address space.

38. Either configured into the software for the machine, or looks it up on a network wideservice (DHCP or BOOTP) using the Ethernet address as the key.

Page 89: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.6. SOLUTIONS TO EXERCISES: SECTION 6.1 89

39. Determines the position of split between the network number and host number portionof the IP address (in this case, 20 bits of network number, 12 bits of host).

40. Try to establish a connection to it. If a service is running, it will begin to negotiate theconnection, indicating the presence of a service. If no service is present, TCP is obligedto send back a message anyway, refusing the connection. If the machine is firewalled,no response is returned.

41. No acknowledgment is received (presumably the packet, or its acknowledgment aredestroyed), so the window cannot advance, which prevents further packets being sentuntil the lost packet is retransmitted. No explicit congestion notification exists, loss ofpackets is assumed to be a symptom of congestion.

A.6 Solutions to exercises: Section 6.11. There are many ways to satisfy the requirements of the design constraints. Some of

these are listed below. Some of these solutions are quite robust, and require severaldevices to be deactivated to disable connectivity. It is assumed in this case that thesedevices will all be wired to a common power point for single switch disconnection.

(a) Satisfy the requirements using the cheapest possible solution: Without exact pricesfor various components, a number of approaches are valid.

i. Use thin Ethernet, 2 segments per lab with repeaters. Place NT servers on theappropriate segment, and use a bridge to connect the two labs. Linux serverconnected to bridge.

ii. Linux or NT boxes can double as Bridges or Routers.iii. Replace repeaters with bridges (creating smaller collision domains), and use

the NT boxes for these bridges.iv. Use a physical tree of Hubs, using 10BaseT cabling. This may be more expen-

sive at this point, but may provide a cheaper upgrade path.v. Introduce asymmetry, and put the Linux box on one of the thin Ethernet seg-

ments, saving a port on the Bridge.vi. 10Base5 (thick Ethernet) to eliminate the use of repeaters, and get more ma-

chines on one segment.(b) Satisfy the requirements using Ethernet technology only:

i. Any of the solutions above.ii. Use switches to connect labs, or to connect up individual machines.

iii. Use fast or multiple links to the servers to improve access speeds.(c) Given access to all of the data link protocols covered in this course, and an unlim-

ited expense account, what changes would you make to the previous model.i. Use an FDDI backbone (rather overkill given the limited distance).

ii. Use fiber connections to reduce noise.iii. Use Token Ring for the labs, rather than Ethernet.iv. Use ATM as a backbone.v. Redundant switches, with backup links. Servers connected to two points.

vi. Mesh topology.vii. Each machine connected to one of 6 switches, each switch connected to the

backbone. Servers connected to the backbone.

Page 90: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

90 APPENDIX A. SOLUTIONS

2. Draw a simple network topology for a statistics computer lab on your campus. Why isthe topology you selected the best choice for the lab?A bus topology may be adequate for a small computer laboratory, where each machinecontains all the applications, and the network is only used for printing, and other lowbandwidth tasks. When using a central server for application sharing than a star topol-ogy may be better, especially if the central device is a switch. A star topology is alsobetter in terms of maintenance and reliability.

3. What is a fat pipe? Why is it important to use this concept in your network design?A fat pipe is a high bandwidth (fast link), normally used to connected switches andservers into the network. If properly used, they remove the bottleneck that may arisewhen many machine, each coming in on their own slower link, try to access this singleresource. A buffering device (such as a switch) will usually be required between themyriad slow links, and the fat pipe.

4. A wealthy Texan Oil Tycoon, and an astute young South African university studenteach become enamored with fractal rendering. They intend to set up companies torender fractals on demand, and sell the resulting images. The faster they can producethe images, the more profit they get. Each raises a loan which covers the purchases of25 machines, 10 with fractal computing cards, and 15 with image display cards. Eachmust fund the network link from personal funds.

(a) Design a network to satisfy the requirements of the intrepid university student.In terms of the fractal rendering scenario used previously, this corresponds to 10servers, and 15 clients. In theory, any client can talk to any server. The specialcards mean that processor overhead is minimal, one can expect network congestionto be the major bottleneck factor.It should be noted that a South African university student is expected to have lesspersonal funds than a wealthy Texan Oil Tycoon. Thus the initial network shouldbe inexpensive. Given that the business should flourish, the network should bedesigned to allow for upgrades as funding allows. Possible solutions include:

i. Legacy Ethernet model, star wired with hubs.ii. Workgroups connected by a backbone switch, with clients and servers dis-

tributed evenly to each workgroup.iii. Server farm model.iv. The trade-offs between large workgroups or smaller, more numerous groups

needs to be considered in light of possible traffic patterns.v. Two hubs, with servers on one, clients on the other. Is this a good design?

Consider upgrade paths.vi. Ethernet bus, using coaxial cable.

vii. Multiple, separate networks, each with a few clients and servers.viii. Token Ring.

ix. Use servers to double as bridges/hubs/routers.x. A hierarchy of hubs and switches.

xi. Everything into one switch (or a hierarchy of switches)(b) Design a network to satisfy the requirements of the oil tycoon.

The tycoon can presumably build a network to satisfy any expectations, such as:i. Redundant paths with multiple switches.

ii. Server farm, with hubs for workgroups, and a backbone switch.iii. Servers on FDDI ring, for speed and reliability.

Page 91: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.6. SOLUTIONS TO EXERCISES: SECTION 6.1 91

iv. Server farm, with fat pipes.v. All machines on one switch, with fat pipes for servers.

vi. Two switches, one for clients and one for servers, possibly multiple links be-tween them (provided they support spanning tree).

vii. Fiber optic cables, or 100Mbps links.viii. Some servers in the workgroups, overflow servers are global.

ix. ATM switches, with redundant links.(c) The student decides to distribute his/her images over the Internet. Show what

extensions to his network would best accomplish this goal, and suggest how thesecould be phased in as finances permitted).Some suggestions for connecting to the Internet:

i. Dial up to the Internet Service provider.ii. Link to the university backbone (requires a very kind university).

iii. Use space on the service provider’s web server.iv. Install a web server at the service provider.v. Install a permanent link to service provider, using a router.

vi. Add local web servers to provide the images.vii. Upgrade links to service provider using ISDN, ADSL or ATM.

5. An innovative South African businessman decides to create a Competitive ShoppingCafe. This will consist of a room with 20 PCs for customers allowing them to conduct E-commerce transactions over the Internet. His innovation is a bank of 15 servers whichwill each connect to a few of the most popular shopping sites and communicate amongstthemselves to determine the lowest price for each particular product.

(a) Discuss the expected traffic patterns on this network.Traffic can be expected as follows:

i. Traffic between customers machines and the servers (to request product op-tions, and purchase items).

ii. Traffic between the servers (to negotiate lowest prices).iii. Traffic between servers and machines on the Internet (to update price lists,

and buy goods on behalf of customers).Other variations on these patterns may be possible depending on the way in whichthe Competitive Shopping Protocol is implemented. Currently we assume that itis server driven, placing the bulk of the traffic between the servers. It can also beclient driven, requiring that each client communicate with all the servers to drivethe negotiation.

(b) Design an initial network layout. Factors to consider are cost and expansion.Suggested components of the design include:

i. Servers on one hub, clients on another, with the hubs connected by a switch tofilter traffic. Works well if the servers negotiate with broadcast messages.

ii. As above, but place the servers on a switch for better point to point communi-cation.

iii. Works groups of customers on a number of hubs connected to a backbone(switch or FDDI) containing the server farm.

iv. Fat pipes to servers.v. Workgroups containing customer machines and associated servers, maybe some

servers located globally.vi. Single large switch containing all nodes.

Page 92: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

92 APPENDIX A. SOLUTIONS

vii. Multiple switches using port trunking (and maybe providing a mesh back-bone).

viii. Workgroups for specific product categories.ix. Central switch with servers attached. 1 or 2 customer machines directly at-

tached to servers, with server performing a routing or bridging function aswell.

Internet connectioni. ISDN PRI, or multiple BRI connections shared amongst the servers.

ii. Satellite or ADSL to Internet, assuming asymmetric traffic patterns (more inthan out).

(c) Suggest ways in which the business will grow, and show how this will affect thedesign of the network.Suggestions:

i. FDDI backbone connecting multiple shops.

6. South Africa contains a number of universities, each which contain a number of depart-ments, each which have computers in laboratories and offices. Each computer needs tohave access to the web. Design a network to facilitate this access, using proxy serversat strategic points, by following the steps below.

(a) Discuss the expected traffic patterns on this network.Laboratories may make frequent use of local laboratory servers to retrieve filesand applications (heavy, but very heavy at certain times of the day). They mayretrieve mail from central university servers, and web pages from the central uni-versity proxy server (medium) which would then retrieve the page from furtherafield. Offices may have similar patterns, although load on a file server can beexpected to be smaller. Proxy servers can be expected to access proxy servers orweb servers at other south african universities, and also internationally (traffic ashigh as possible).Some departments may have different demands.

(b) Show the network layout, explaining the advantages of your design.Some suggested strategies:

i. External access via ISDN (BRI or PRI for more bandwidth), or ATM for veryhigh bandwidth. FDDI has not the range for wide area links in this case.

ii. Backbone technologies: FDDI, high speed Ethernet switches (with port trunk-ing to work group switches), ATM switches

iii. Some servers local to workgroups (lab file servers), other global on the back-bone (proxies, email). Fat pipes to high demand servers.

iv. Separate, or redundant links for management of the network.v. Workgroups using hubs (cheap, low traffic) or switches (more expensive, higher

traffic).(c) Show the positioning of proxy servers and describe their communication strategies.

i. Multiple proxies, per department to handle different traffic patterns and re-strictions.

ii. Hierarchical proxies, so client checks university proxy, which checks other uni-versity proxies, then country proxy, then only asks server for data.

iii. An array of proxies for load sharing.

7. Design a network to support the requirements listed below. Draw the network layout,and explain how your network satisfies each requirement.

Page 93: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.6. SOLUTIONS TO EXERCISES: SECTION 6.1 93

(a) The building contains two departments, department A occupies the upper twofloors of a three story building, and department B occupies the bottom floor.

(b) Each department has its own set of servers. In addition, there is a global serverused by both departments.

(c) The top floor is occupied by a 35 machine laboratory which requires access to de-partment A’s servers, and to the global server. Traffic from this laboratory mustnot impact on the performance of the rest of department A’s network.

(d) Excluding the laboratory, department A has 10 machines, and department B has15.

(e) Finances are limited, but substantial growth is expected in department A in thenear future.

8. A large Hollywood based consortium wants to invest in a production studio for pro-ducing computer animated movies in South Africa, where the cheap labour can be ex-ploited. Design a network for them, containing the following features:

(a) Animators (from various companies) wish to work in a large open plan area wherethey can freely exchange ideas, but must be able to save work on a server dedicatedto their company. Typically 50-100 animators will be employed at any one time.

(b) A large rendering farm must be able to retrieve scene description files from a cen-tral server, distribute the rendering workload over about 1000 stations, and uploadthe finished frames back onto centralized storage.

(c) A production facility will be made available, for writing sequences of renderedframes to film or tape.

(d) Facilities to upload complete animation sequences to studies in Hollywood are re-quired.

Create the network design in the following steps. For each design step, explain theadvantages and disadvantages of your design.

(a) Estimate the amount of traffic involved in each part of the network.(b) Design a pilot network supporting 10% of the total capacity, to be part of the in-

vestment proposal.(c) Show the design for the complete network, showing which pieces of the pilot net-

work you would reuse. Cost effective design is very important.(d) The rand strengthens against the dollar as Georgie Bush is impeached for incom-

petence. Imported networking equipment becomes cheap. Describe the changesyou would make to your design.

9. Before designing a network for a client, what parameters of the network do you need toknow?Many issues: cost, traffic patterns, size, reliability, nature of traffic, ...

10. The Computer Science Department has come up with a radical new concept. Two newresidences will be constructed under the Hamilton building and 3rd year ComputerScience students will be housed there. Each student will spend 24 hours per day ina cubicle equipped with a floor luxuriously strewn with a layer of straw, a networkconnection and a computer. Lectures will be transmitted in as video files for 12 hoursa day and 8 hours per day will be spent on practical exercises. During the copious idletime, the machines will be configured as rendering servers.

Page 94: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

94 APPENDIX A. SOLUTIONS

(a) Assuming 90 students, design a suitable network. Indicate any assumptions re-garding cost and performance. Include the infrastructure required to support thisarrangement, and illustrate how your design would integrate into existing net-work facilities.

(b) Since the idea is likely to catch on, show how your network could be expanded asthe local facility grows (and we dig deeper).

(c) Show how the network could expand as we integrate new campuses at Pofadderand Nelspruit.

11. Give an example of:

(a) CBR traffic(b) VBR traffic

CBR traffic has a constant bit rate: same amount of data for each time unit such asregular updates of traffic statistics or uncompressed audio and video data. VBR traf-fic has rates that vary over time, such as compressed video and audio, in which thecompression rate may vary according to the amount of changed image or volume.

12. A telecommunications provider has 5 customers needing a 50Mbps CBR service. Thetraffic will be transmitted over an OC3 (155Mbps) link.

(a) What networking technology could be used?(b) How can the bandwidth contention be resolved?

ATM would be used to provide a CBR service (alternatively a dedicated channel couldbe setup for each customer). However ATM supports the 155Mbps rate. To resolve theconflict, increase the price of the service until two customers drop out, or elect to putup with VBR service.

13. Which networking technology would give:

(a) Cheapest LAN(b) Fastest LAN(c) Fastest WAN(d) Most reliable LAN

Cheap: Ethernet. Fast LAN: Gigabit Ethernet. Fast WAN: ATM. Most reliable LAN:FDDI with dual ring, or some mesh connected ATM.

14. What technology would provide:

(a) fastest routing(b) cheapest routing

ATM switching is fast, requires only 1 byte field to route packets on. Cheap routing canbe provided by a PC with multiple network cards.

15. Telkom puts out a request for bids to supply switches for its ATM core network. Allsuppliers must supply one sample unit, which will be forfeited if the bid fails, andremain part of the Telkom network. Is this a good idea?Potentially bad, because the network now has a legacy of different systems that haveto be supported, and inter-operation issues resolved.

Page 95: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.6. SOLUTIONS TO EXERCISES: SECTION 6.1 95

16. Why should cycles be avoided within an Ethernet network? What difference betweenEthernet and ATM allows cycles to occur within ATM networks?Broadcast packets are duplicated down every link. With more than one route betweennodes, the total number of packets will increase and return to points on the networkthat have seen them previously. Eventually the network will saturate from this broad-cast storm. ATM does not use broadcast, but sets up paths between nodes before anycommunication occurs.

17. An FDDI backbone is used to connect a switched Ethernet workgroup to a server. Isthis a good design?For only one server, a single piece of cable would work just as well.

18. A hub is used as a backbone for a number of switched Ethernet workgroups. Is this agood design?If the traffic across the backbone is low, then the workgroup switches may be sufficientto filter the traffic.

19. Would a “server farm” or a “distributed server” model be better for a network containingredundant (duplicate backup) servers?Server farm is more likely to have the servers in one place, leading to potential sin-gle points of failure. The server farm does not discriminate between servers so wouldsupport equals load balancing.

20. An Ethernet network is wired with 10Base2, and has a number of stations each broad-casting 100 packets per second of 1500 bytes each. How does the amount of traffic onthe network vary with the number of machines?It can be expected to rise with number of machines but taper off as the network becomessaturated and collisions start to dominate. The exact effects are difficult to calculateexplicitly (particularly with random numbers in the Ethernet backoff process), but be-haviour could be modelled using simulation or Petri Nets.

21. Switches may have less latency (particularly cut-through switches), and can directpackets with any layer 3 protocol, instead of only IP.

22. The Ethernet address of the local router - which will remove the layer 2 Ethernetheader, and replace it with headers suitable for which layer 2 protocol it uses for itswide area Internet link.

23. Hub or switch turn out to be pretty much equivalent. May want to look at high speedlink for the server.

24. Have the device keeps statistics on the number of packets/bytes that it sends/receives.Devise a protocol that can retrieve and display these statistics.

25. Potentially anything related to performance, configuration, accounting, faults and se-curity.

26.

(a) Cycles should not exist unless spanning tree protocol is used to resolve addressingproblems.

(b) Extra switches provide no redundancy as there are still single points of failure.(c) Lower speed links in the backbone are a bottleneck.(d) Workgroup specific servers could best be located in the workgroups themselves.(e) Internet connection breaks symmetry, also not protected from the internal net-

work.

Page 96: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

96 APPENDIX A. SOLUTIONS

A.7 Solutions to exercises: Section 7.1

1.

Sending amessage

Awaiting reply

Printing results

Waiting formessage

Printing message

Calculating response

Sendingresponse

Messagesent

Printingcomplete

Responsecalculated

Replysent

Resultsprinted

2. Notes: The server gets its own queue, although it is unable to ever put more than oneitem in it. We also allow the calculation of the response to run in parallel with theprocess of printing the response.

Sending amessage

Awaiting reply

Printing results

Waiting formessage

Printing message

Calculating response

Sendingresponse

Messagesent

Printingspooled

Responsecalculated

Replysent

Resultsspooled

Jobs in queuefrom client

Jobs in queuefrom server

Awaitingconfirmation

Printingcomplete

Printer free

Printingclientjob

Printingserverjob

3. The states of the server are unchanged, although to make things clearer we can reliablethe state of waiting for a message as “Idle: Waiting for a message”. The client can eitherbe written to perform concurrent processing, or (more realistically) to have some morestates:

Page 97: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.7. SOLUTIONS TO EXERCISES: SECTION 7.1 97

a Want to send to server A and Bb Waiting for reply from A, able to send to Bc Waiting for reply from B, able to send to Ad Waiting for either A or B.e Printing response from A, still waiting for Bf Printing response from B, waiting for A.g Printing response from A, able to send to Bh Printing response from B, able to send to At1 Reply from A finished printingt2 Reply from B finished printingt3 Sent to At4 Reply from Bt5 Sent to Bt6 Reply from At7 Sent to Bt8 Sent to At9 Reply from B finished printingt10 Reply from A finished printing

Waiting formessage

Printing message

Calculating response

Sendingresponse

Printingcomplete

Responsecalculated

Idle:Waiting formessage

Printing message

Calculating response

Sendingresponse

Printingcomplete

Responsecalculated

Idle:a)

Server A Server B

c) b)

d)h)

g)

f) e)

t1

t2

t3 t4 t5 t6

t7 t8

t9 t10

Note: The client is unable to communicate with either server while printing. Additionalstates could be added to allow this, but are not required.Alternative solutions exist. Allowing the client to make use of a multi-threaded (con-current) platform, gives separate states for each of the two threads of execution. Thisis shown below:

Page 98: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

98 APPENDIX A. SOLUTIONS

responseSending

responseCalculating

messagePrinting

messageWaiting for

Awaiting reply

Printing results

Waiting formessage

Printing message

Calculating response

Sendingresponse

Sending amessage

Server 1Client

Server 2

Alternatively, the simplest, and most elegant solution is to allow the client to exist ina number of states simultaneously. This can be done by providing additional tokens tothe client, as shown below:

responseSending

responseCalculating

messagePrinting

messageWaiting for

Awaiting reply

Printing results

Sending amessage

Server 1Client

Waiting formessage

Printing message

Calculating response

Sendingresponse

Server 2

4. To perform the classification we need the reachability tree for each of these cases. Thetree is really a graph and will be illustrated here in another form: the state transitionmatrix (the two forms are equivalent, so you can draw the reachability tree from thematrix).

(a) Reachability Tree has 6 nodes.• Place 1 is not Safe

Page 99: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.7. SOLUTIONS TO EXERCISES: SECTION 7.1 99

• Place 2 is not Safe• Place 3 is not Safe• Net is not Safe• Place 1 is 4 bounded• Place 2 is 2 bounded• Place 3 is 2 bounded• Net is 4 bounded• Net is not Live• Net is not ConservativeTo\From (4,0,1) (2,1,1) (0,2,1) (1,0,2) (2,0,0) (0,1,0)

(4,0,1)(2,1,1) T1(0,2,1) T1(1,0,2) T2(2,0,0) T3(0,1,0) T1

(b) Reachability Tree has 2 nodes.• Place 1 is not Safe• Place 2 is Safe,• Place 3 is not Safe• Net is not Safe• Place 1 is 2-bounded• Place 2 is 1-bounded• Place 3 is 2-bounded• Net is 2-bounded• Net is Live• Net is ConservativeTo\From (2,0,1) (0,1,2)

(0,1,2)(0,1,2) T1 T2

(c) Reachability Tree has 4 nodes.• Place 1 is not Safe• Place 2 is not Safe• Place 3 is Safe• Place 4 is Safe• Net is not Safe• Place 1 is 2-Bounded• Place 2 is 2-Bounded• Place 3 is 0-Bounded• Place 3 is 1-Bounded• Net is 2 Bounded• Net is not Live• Net is not ConservativeTo\From (2,2,0,0) (1,1,0,0) (0,0,0,1) (0,2,0,0)(2,0,0,0)(1,1,0,0) T2(0,0,0,1) T1(0,2,0,0) T2

Page 100: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

100 APPENDIX A. SOLUTIONS

5. The reachability tree has the following states, and transitions:To\From (2,1,1,1,0) (2,1,0,0,1) (3,1,0,0,0) (2,2,0,0,0) (2,0,1,1,0) (2,0,0,0,1) (3,0,0,0,0) (2,1,0,0,0)(2,1,1,1,0)(2,1,0,0,1) T4(3,1,0,0,0) T1(2,2,0,0,0) T2(2,0,1,1,0) T3(2,0,0,0,1) T4(3,0,0,0,0) T1(2,1,0,0,0) T2

Place 1 is 3 bounded. The place corresponds to the reactor core, and never exceeds3000K. Thus the reactor does not overheat and explode. The net is not conservative,therefore material is being stolen somewhere, which will be to the detriment of thecontinued operation of the reactor.

6. Draw the reachability tree, and determine the properties of the Petri Net shown below:

P0

P1

P2

P3

P4

P5

T0

T1

T2 T3

7. Design a Petri Net to model an HTTP server, with 3 clients. Each client may send arequest, wait for the response, and spend a while reading the page. The server canaccept one request at a time, retrieve the requested page, and send the response back.

(a) Draw the net, and explain the meanings of all places and transitions.(b) Determine the properties of your Petri Net.(c) What changes would be required to allow the server to handle two requests simul-

taneously?

8. Design a program that simulates a Petri Net. In particular list the fields and methods(with comments) for Place and Transition classes. Supply the algorithm for firing atransition.

Page 101: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.7. SOLUTIONS TO EXERCISES: SECTION 7.1 101

class Place{

// number of tokens in that place.int tokens;Place ();~Place ();void SetInitialMarking (int value);int GetNumberOfTokens ();void RemoveToken (int number = 1);void AddToken (int number = 1);

};

class Transition{

Place * inplaces [MAXLINK];int inmultiplicity [MAXLINK];int numin;Place * outplaces [MAXLINK];int outmultiplicity [MAXLINK];int numout;Transition ();~Transition ();/* add p as a source of an incoming link to

this transition. Duplicates should not beadded - increase multiplicity instead */

void AddIn (Place * p, int multi = 1);/* add p as a sink of an outgoing link from

this transition. Duplicates should not beadded - increase multiplicity instead */

void AddOut (Place * p, int multi = 1);/* Can the transition fire? */int Enabled ();/* Fire the transition. */void Fire ()

{int i;for (i = 0; i < numin; i++)inplaces[i]->RemoveToken (inmultiplicity[i]);

for (i = 0; i < numout; i++)outplaces[i]->AddToken (outmultiplicity[i]);

}};

class PetriNet{Place places[];Transition transitions[];

};

9. Time is often associated with Petri Net models by assuming that a transition will notfire instantaneously, but that a finite duration will elapse between consuming the to-kens from the input places, and placing tokens in the output places. Show how thesimulation algorithm can be used to simulate a Time Petri Net.The simulation algorithm for Black/White Petri Nets is:

Page 102: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

102 APPENDIX A. SOLUTIONS

ForeverIdentify enabled transitionsIf none enabled then endChoose one transitionFire transition, remove input tokens and place output tokens

Extending this by assuming that Transition Ti takes time ti to fire:

time = 0Forever

Identify enabled transitionsIf none enabled then endChoose one transition Tx

time = time + txFire transition Tx, remove input tokens and place output tokens

The algorithm above allows only one transition to fire at a time. To allow simultaneousfiring of independent transitions, we need the event queue, sorted on event time, asused in the general simulation algorithm. The queue entries can be either:

record: start of firingtime of starttransition being fired

orrecord: end of firing

time of endtransition being fired

The algorithm then becomes:

time = 0Q is emptyAdd enabled transitions as start of firing events to Qwhile Q is not empty

Remove earliest entry from Q, corresponding to transition Tx

time = time of this eventif event is start of firing and

Tx is still enabled thenremove input tokens for Tx

add end of firing event for Tx at time time + txif event is end of firing thenplace output tokens for Tx

add start of firing event for any enabled transitions at time time

10. Create a Petri Net model of a simple E-commerce application, with one Shop, 10 prod-ucts and and one Customer. The events pertaining to the customer are:

• Request list of products• Receive list of products• Buy Product

The Shop on the other hand sees the following events:

• Receive request for list• Send list of products

Page 103: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.7. SOLUTIONS TO EXERCISES: SECTION 7.1 103

• Sell Product• Post product to customer

List the partial states of both Shop and Customer that are pre- and post-conditions forthese events. Create the Petri Net.Answer:Partial states of the Customer:

• P1: State of preparing a request for a list of products.• P2: State of waiting for a list of products.• P3: State of selecting a product to buy.• P4: State of having money to buy products.

Partial States of the Shop:

• P5: State of having products in the shop.• P6: State of being able to being able to provide customer service.• P7: State of preparing a list of products.• P8: State of ringing up the sale of a product.

It is important to realize the some of these events are the same thing, just seen fromdifferent viewpoints (that of customer or shop). Thus the event list is:

Pre-conditions Event Post-conditionsP1, P6 T1: list requested by customer from shop P2, P7P2, P7 T2: list sent by shop to customer P3, P6

P3, P6, P4, P5 T3: product sold by shop, bought by customer P3, P8P8 T4: product posted by shop P6

The resulting Petri Net is shown in Figure A.5.

11. Design a Petri Net to model the retrieval of a web page from a server via a proxy by aclient. Create models for the following situations:

(a) One client, one proxy, one server.(b) Two clients, one proxy, one server.(c) Two clients, one proxy, three servers.

Remember to specify the partial states of the system, and the meaning of all places andtransitions.

12. A model of a pyramid investing scheme assumes each participant works as follows:

(a) Each participant requests 1$ from two other participants.(b) Each participant pays at most 1$ to one other participant in the scheme.

Show the states and events associated with one of these participants. Create a PetriNet model of a simple system with 3 participants. Is there any way for all of them tomake money?

Page 104: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

104 APPENDIX A. SOLUTIONS

P1

P2

P3

P4

P5

P6

P7

P8

T1

T2

T3

T4

Figure A.5: Petri net for customer-shop exercise.

13. We want to create a model of the CSMA/CD operation of Ethernet. For this model, wewill assume that two stations exist on a single Ethernet segment. Each station hasthree packets that it wants to broadcast.

(a) Identify the participants in the model.(b) Identify the states of each participant in the model.(c) Identify the events that cause a change in state at each station.(d) Identify the states that must exist before each event can occur.(e) Identify the states that will exist after each event does occur.(f) Create the Petri Net corresponding to this system.(g) Determine the properties of this Petri Net.

Partial solution:

(a) The participants are:i. The three stations.

ii. The transmission medium.(b) The states of a station are:

i. Have n packets to sendii. Ready to send another packet.

iii. Confirmed carrier at station cleariv. Transmittingv. Backed off, and ready to try again.

Page 105: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.7. SOLUTIONS TO EXERCISES: SECTION 7.1 105

P1: Station 1 has n packetsto send

P2: Station 1 is backed off P3: Station 1 transmitting

P4: Station 1 has clear carrierP5: Station 1 Ready to send

P6: Station 2 has n packetsto send

P7: Station 2 is backed off P8: Station 2 transmitting

P9: Station 2 has clear carrierP10: Station 2 Ready to send

P11: Carrier is clear P12: Signal is being transmitted P13: Collision is on wire

T1: Station 1 checks carrier

T2: Station 1 start transmitting

T3: Station 1 starts transmitting

T9: Both parties have detected collision

T4: Transmission complete

T5: Station 2 checks carrier

T6: Station 1 start transmitting

T7: Station 2 starts transmitting

T8: Transmission completeT10: Begin retry

T11: Begin retry

Figure A.6: Petri Net modelling CSMA/CD operation.

The states of the medium are:i. Have signal.

ii. Have collision.iii. Carrier clear.

(c) The events that can occur (for each station):i. (Station has packet to send, ready to send, carrier clear) Check carrier (con-

firmed carrier clear, carrier clear)ii. (confirmed carrier clear, carrier clear) Start transmitting (transmitting, have

signal)iii. (confirmed carrier clear, have signal) Start transmitting (transmitting, have

collision)iv. (transmitting, have signal) Complete transmitting (ready to send another packet,

carrier clear)v. (transmitting from a, transmitting from b, have collision) Collision detected

(backed off a, backed off b, carrier clear)vi. (backed off, carrier clear) Begin retransmit (confirmed carrier clear, carrier

clear)

The resulting Petri Net is shown in Figure A.6.

14. We can model an unreliable network as one which drops every third packet. Create aPetri Net model of the Positive Acknowledgment with Retransmit aspect of TCP whichneeds to send ten packets from one machine to another. Determine the properties ofthe net. What is the maximum number of packets which would need to be sent by eachmachine?

15. Show the state (marking) of the following Petri Nets after three transitions have fired.

Page 106: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

106 APPENDIX A. SOLUTIONS

P1

P2

T1 T2

P1 P1

P2 P2

T2T1 T1

T3

T2

P3

First Net: (1,0,0):T1:(0,1,0):T3:(1,0,1):T1(0,1,1) or (1,0,0):T1:(0,1,0):T2:(0,1,0):T3(1,0,1)or (1,0,0):T1:(0,1,0):T2:(0,1,0):T2(0,1,0).Second Net: (2,0):T1:(0:2):T2:(1:1):T2:(2,0).Third Net: (1,0):T1:(0,1):T2:(2,0):T1(1,1)

16. Create a Petri Net modelling 3 (rich) students, each wanting to buy 2 beers from theRat, whose complete stock consists of 5 beers.

Student 2 wants n beers

Student 1 wants n beers

Student 3 wants n beers

Student 2 has n beers

Student 1 has n beers

Student 3 has n beers

Student 1 buys beer

Student 2 buys beer

Student 3 buys beer

Rat has n beers

17. What do each of the following Petri Net structures correspond to in a physical system:

(a) place(b) transition(c) input arc(d) output arc(e) token

Place: state of a part of the system. Transition: event. Input arc: states before an eventcan take place. Output arc: states after an event has occurred. Token: Indication thatthe state is present (and to what degree).

Page 107: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.7. SOLUTIONS TO EXERCISES: SECTION 7.1 107

18. What would be the physical significance of the total number of tokens changing overthe different markings?

Quantities are being used and created, or that tokens have different meaning in differ-ent states.

19. How can you tell if a system gets into a state where it cannot proceed any further?

No further transition will be enabled in the Petri Net model.

20. Create the reachability tree for this Petri Net:

P1: Workers have n dollars.

T4: Government ministers buy 4x4

T3: Government prints money

T2: Government hires contractors

P2: Government has n dollars.P3: Banks have n dollars

T1: Government taxes workers

22

[2, 0, 1]T1 T2

[1, 0, 2]T1

T2

[0, 0, 3]T2

[0, 1, 2]T2

T3

[0, 2, 1]T2

T3

T4

[0, 3, 0]

T3

T4

[1, 1, 1]

T1

T2

T3

[1, 2, 0]

T3

T4

[2, 1, 0]

T3

21. Calculate the boundedness, liveness and conservation properties of this Petri Net.

Place: 0 is 2 bounded Place: 1 is 3 bounded Place: 2 is 3 bounded The Petri Net is notsafe. The Petri Net is 3 bounded. The Petri Net is live. The Petri Net is conservative.

22. What does the conservation property imply about the state of the economy?

Money is not being created or lost.

23. Create the reachability tree for this Petri Net:

Page 108: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

108 APPENDIX A. SOLUTIONS

P1: Traffic lights (Robots) green North to South

T1: Lights change to N−SP2: Traffic lights (Robots) green West to East

T2: Lights change to W−E

T3: Lights change while pedestrian crosses

P3: Pedestrian crossing green

T4: Pedestrian pushes buttonP4: Pedestrian crossing red

T5: Pedestrian finishes crossing

[1, 0, 0, 1]T1

T4[0, 1, 0, 1]

T2

T4

[0, 1, 1, 0]T2 T3

T5

[1, 0, 1, 0]

T1

T5

[1, 0, 0, 0]T1

[0, 1, 0, 0]

T2

24. Calculate the properties of this Petri Net.Place: 0 is 1 bounded (Safe) Place: 1 is 1 bounded (Safe) Place: 2 is 1 bounded (Safe)Place: 3 is 1 bounded (Safe) The Petri Net is safe. The Petri Net is 1 bounded. The PetriNet is live. The Petri Net is not conservative.

25. What do these properties imply about the reliability of the traffic control system.Place: 0 is 1 bounded (Safe) Place: 1 is 1 bounded (Safe) Place: 2 is 1 bounded (Safe)Place: 3 is 1 bounded (Safe) The Petri Net is safe. The Petri Net is 1 bounded. The PetriNet is live. The Petri Net is not conservative.

26. What properties can be derived from an incomplete reachability tree?If the number of tokens in any state exceeds 1, then that state is not safe, and theentire net is not safe. We cannot prove that a state or the whole net is safe. We cannotdetermine boundedness of any state or the net. If one state has no transitions enabledthen the net is not live. We cannot prove that the net is live. If the number of tokens isnot constant in the available states then the net is not conservative. We cannot provethat the net is conservative, even if the sampled state all have the same number oftokens.

27. What component of a Petri Net could have time associated with it?The event would take time to complete. States are of indefinite duration.

28. Consider (try to create) a Petri Net to model a store (such as a queue) with a limit of 5elements.

(a) How do you detect overflow?

Page 109: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.7. SOLUTIONS TO EXERCISES: SECTION 7.1 109

(b) How do you detect underflow?

Overflow: Have a state for the number of gaps in the store. Require that there be atoken in this place before new objects can be added. Underflow: Have a state for thenumber of objects in the store, which is a pre-condition for the remove event. Removingand adding to the store have the appropriate one of these states as postconditions.

29. Suppose you model a system with m clients and n servers. You have separate eventsfor the client sending a request to a server, and the server sending the response back.How do the servers keep track of which client to reply to?

You need a state for every server corresponding to each of the clients it may need to beresponding to.

30. Does the time taken to simulate a Petri Net have any relationship to the time requiredfor the system modelled by that Petri Net to run?

No, simulation and models do not have a time relationship.

31. How can the use of random numbers be justified in a simulation?

Many real world events do not take an exact amount of time, so random numbers withthe same distribution will mimic the real world situation. Average accumulated be-haviours for both real and modelled systems should match.

32. Suggest another modelling technique that can be used for creating a computer simula-tion.

Many: State transition diagrams, grammars (may simulate the creative writing pro-cess), maze traversal (simulates rats), models used in SimCity.

33. How does one measure performance using a computer simulation.

Usually one is interested in the rate at which events occur, or the time spent per iter-ation. Variables that accumulate the number of events, or measure the start and endtimes (simulated) and accumulate the simulated delay can then be combined with thesimulated time to give rate of events, or average time per event.

34. What benefits could result from performing a computer simulation.

Usually one is interested in the rate at which events occur, or the time spent per iter-ation. Variables that accumulate the number of events, or measure the start and endtimes (simulated) and accumulate the simulated delay can then be combined with thesimulated time to give rate of events, or average time per event.

Page 110: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

110 APPENDIX A. SOLUTIONS

35.

P1: n shop assistants are free

P2: n drugs are available

P3: Customer 0 wants to buy n drugs

P4: Customer 0 gets served (n)

P5: Customer 0 has bought n drugs

P6: Customer 1 wants to buy n drugs

P7: Customer 1 gets served (n)

P8: Customer 1 has bought n drugs22

1

1T1: Customer 0 is being served.

1

1

122

T2: Customer 0 buys drug.

1

1

22

T3: Customer 0 refuses to buy.

22

1

1T4: Customer 1 is being served.

1

1

122

T5: Customer 1 buys drug.

1

1

22

T6: Customer 1 refuses to buy.

36.

[3, 3, 2, 0, 0, 2, 0, 0]T1 T4

[1, 3, 1, 1, 0, 2, 0, 0]T2 T3

[3, 2, 1, 0, 1, 2, 0, 0]T1 T4

[1, 2, 0, 1, 1, 2, 0, 0]T2 T3

[3, 1, 0, 0, 2, 2, 0, 0]T4

[1, 1, 0, 0, 2, 1, 1, 0]T5 T6

[3, 0, 0, 0, 2, 1, 0, 1]T4

[1, 0, 0, 0, 2, 0, 1, 1]

[3, 0, 0, 0, 2, 1, 0, 0]T4

[1, 0, 0, 0, 2, 0, 1, 0]

[3, 1, 0, 0, 1, 2, 0, 0]T4

[1, 1, 0, 0, 1, 1, 1, 0]T5 T6

[3, 0, 0, 0, 1, 1, 0, 1]T4

[1, 0, 0, 0, 1, 0, 1, 1]

[3, 0, 0, 0, 1, 1, 0, 0]T4

[1, 0, 0, 0, 1, 0, 1, 0]

[1, 2, 1, 0, 1, 1, 1, 0]T5 T6

[3, 1, 1, 0, 1, 1, 0, 1]T1 T4

[1, 1, 0, 1, 1, 1, 0, 1]T2 T3

[1, 1, 1, 0, 1, 0, 1, 1]T5 T6

[3, 0, 1, 0, 1, 0, 0, 2]T1

[1, 0, 0, 1, 1, 0, 0, 2]

[3, 0, 1, 0, 1, 0, 0, 1]T1

[1, 0, 0, 1, 1, 0, 0, 1]

[3, 1, 1, 0, 1, 1, 0, 0]T1 T4

[1, 1, 0, 1, 1, 1, 0, 0]T2 T3

[1, 1, 1, 0, 1, 0, 1, 0]T5 T6

[3, 0, 1, 0, 1, 0, 0, 0]T1

[1, 0, 0, 1, 1, 0, 0, 0]

[3, 2, 1, 0, 0, 2, 0, 0]T1 T4

[1, 2, 0, 1, 0, 2, 0, 0]T2 T3

[3, 1, 0, 0, 0, 2, 0, 0]T4

[1, 1, 0, 0, 0, 1, 1, 0]T5 T6

[3, 0, 0, 0, 0, 1, 0, 1]T4

[1, 0, 0, 0, 0, 0, 1, 1]

[3, 0, 0, 0, 0, 1, 0, 0]T4

[1, 0, 0, 0, 0, 0, 1, 0]

[1, 2, 1, 0, 0, 1, 1, 0]T5 T6

[3, 1, 1, 0, 0, 1, 0, 1]T1 T4

[1, 1, 0, 1, 0, 1, 0, 1]T2 T3

[1, 1, 1, 0, 0, 0, 1, 1]T5 T6

[3, 0, 1, 0, 0, 0, 0, 2]T1

[1, 0, 0, 1, 0, 0, 0, 2]

[3, 0, 1, 0, 0, 0, 0, 1]T1

[1, 0, 0, 1, 0, 0, 0, 1]

[3, 1, 1, 0, 0, 1, 0, 0]T1 T4

[1, 1, 0, 1, 0, 1, 0, 0]T2 T3

[1, 1, 1, 0, 0, 0, 1, 0]T5 T6

[3, 0, 1, 0, 0, 0, 0, 0]T1

[1, 0, 0, 1, 0, 0, 0, 0]

[1, 3, 2, 0, 0, 1, 1, 0]T5 T6

[3, 2, 2, 0, 0, 1, 0, 1]T1 T4

[1, 2, 1, 1, 0, 1, 0, 1]T2 T3

[1, 2, 2, 0, 0, 0, 1, 1]T5 T6

[3, 1, 2, 0, 0, 0, 0, 2]T1

[1, 1, 1, 1, 0, 0, 0, 2]T2 T3

[3, 1, 2, 0, 0, 0, 0, 1]T1

[1, 1, 1, 1, 0, 0, 0, 1]T2 T3

[3, 2, 2, 0, 0, 1, 0, 0]T1 T4

[1, 2, 1, 1, 0, 1, 0, 0]T2 T3

[1, 2, 2, 0, 0, 0, 1, 0]T5 T6

[3, 1, 2, 0, 0, 0, 0, 0]T1

[1, 1, 1, 1, 0, 0, 0, 0]T2 T3

The Petri Net is not live. The shop either runs out of drugs, or customers who want tobuy.

37. The Petri Net is not conservative. The tokens change meaning in the individual places(either number of customer, assistants or drugs, or a boolean value to indicate thepresence of a certain partial state, so no significant conclusion can really be drawn.

38. Place 1 is 3 bounded Place 2 is 3 bounded Place 3 is 2 bounded Place 4 is 1 bounded(Safe) Place 5 is 2 bounded Place 6 is 2 bounded Place 7 is 1 bounded (Safe) Place 8 is 2bounded. The Petri Net is 3 bounded. Places that indicate the presence or abscence of agiven state should be 1 bounded (or safe), which they are - although this might change

Page 111: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.8. SOLUTIONS TO EXERCISES: SECTION 8.1 111

if more shop assistants were present with this model. No customer gets more than 2drugs which is consistent with the expectations for the system.

39. Some places represent boolean values: either the state occurs, or it doesn’t. More thanone token indicates a flaw in the model, or a problem with the system.

40. Cannot say anything about liveness. Place 1 is not safe, so the net is not safe. No otherboundedness information can be derived. The sample set of marking all has the samenumber of token, so no evidence that the net is not conservative, but it is impossible tobe certain without checking all states/markings.

41. Transitions corresponding to client n sends to server m, and server m respondsto client n are required. Care should be taken that each client has a waiting state foreach of the servers, otherwise requests and responses could become muddled.

42. Associate a time value with the transition. When the transition occurs, remove tokensfrom input places. Schedule an event for current simulated time + time required fortransition, and continue processing other events. When this event becomes current,place the tokens in the output places.

43. Choose random numbers in the required range. Either mean±(rand*deviation), whenrand is a random number between -1 and 1, or using a weighting system: if value Aoccurs n% of the time, and value B otherwise then choose a random number between 1and 100, if it is between 1 and n, then use value A, otherwise use value B (this can beadapted for a larger range of numbers).

44. The time at which a particular state occurs becomes significant. States are no longeridentified only by their markings, but the time at which they occur. The same state canoccur quite often at different times, making the tree much more complex, and poten-tially infinite for live systems.

45. Examine the difference between the simulated time for a certain event to calculate thetime interval between the event repeating (or alternatively, the rate at which the eventoccurs).

46. Long enough for it to settle down to a stable state. Ignore transient effects when thesimulation starts.

A.8 Solutions to exercises: Section 8.11. You are contacting vendors about purchasing a new router. Some vendors support

SNMP while others support CMIP. Which vendor would you choose? Why?At present SNMP is better supported, and a better choice. Other factors which mayaffect the decision are the type of devices already in the network, and the overheadrequired to support the protocol in the device (a complex protocol may have performanceimplications for the device).

2. What is MIB? How is it used?The Management Information Base is used to store the values of the variables thatcan be accessed via SNMP get and set requests. The MIB is stored as a tree, with thefull name of the variable given by the path from root to leaf. Names can be symbolic,for human consumption, or translated directly into numeric form for use by machines.Values specified in the MIB normally have type, access mode, status and a descriptionof their purpose given.

3. Explain the following terms:

Page 112: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

112 APPENDIX A. SOLUTIONS

(a) MIB : Management Information Base, the database of values that can be accessedby the management system.

(b) ASN.1 : Abstract Syntax Notation is used to specify the structure of the packet inthe SNMP (and for other protocols).

(c) BER : Basic Encoding Rules specify how ASN.1 can be converted between humanreadable format and a numeric, machine readable form.

4. How does the use of the Basic Encoding Rules compare to the encoding of the headerfields used in Ethernet, IP, UDP and TCP?The BER encode the grammar of ASN.1, and a parsing process is used to reconstructthe original series of fields. Values, types and sizes are all encoded via the BER. Theencoding used for Ethernet, IP, UDP and TCP has all used a template matching process,with all fields specified in advance, with immutable types and sizes.

5. Give the full symbolic and numeric MIB path names as well as ASN.1 specifications forthe following variables:For the values below, assume the following ASN.1:iso ::= { 1 }org ::= {iso 3 }dod ::= { org 6 }internet ::= { dod 1 }mgmt ::= { internet 2 }mib-II ::= { mgmt 1 }system ::= { mib-II 1 }interfaces ::= { mib-II 2 }

(a) sysDescriso.org.dod.internet.mgmt.mib-II.system.sysDescr1.3.6.1.2.1.1.1sysDescr ::= { system 1 }

(b) sysUpTimeiso.org.dod.internet.mgmt.mib-II.system.sysUpTime1.3.6.1.2.1.1.3sysUpTime ::= { system 3 }

(c) IfInOctetsiso.org.dod.internet.mgmt.mib-II.interfaces.ifTable.ifEntry.IfInOctets1.3.6.1.2.1.2.2.1.10ifTable ::= { interfaces 2 }ifEntry ::= { ifTable 1 }ifInOctets ::= { ifEntry 10 }

6. Compare a UDP client-server fractal rendering system to an SNMP agent-managerpair, showing any correspondences between components and protocols that may exist.

(a) Client requests values, just as the SNMP manager does.(b) Server responds to requests, just as the SNMP agent does.(c) Both use UDP as the underlying transport, and make use of a connectionless data-

gram service.

Page 113: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.8. SOLUTIONS TO EXERCISES: SECTION 8.1 113

(d) The fractal rendering system sends a get request and responds with a get response(of a kind). SNMP also includes set, and trap PDUs.

7. In what ways would network management be useful in an E-commerce environment?

• Performance: detecting bottlenecks in the network that may be slowing down re-sponse to customers.

• Configuration: Managing multiple servers, bringing in replacement or standbymachines if a failure is detected.

• Accounting: Keeping track of utilization, measuring hits rates for calculating ad-vertising revenue.

• Faults: Detecting failures to ensure minimum downtime.• Security: Isolate financial transactions, detect intrusion and tampering.

8. Describe how network management could be applied to web proxy servers:

(a) How could SNMP be used for management in this scenario?(b) Suggest MIB variables that would be used for management (either specify your

own, or reuse others that already exist). Specify at least the syntax, descriptionand position in the hierarchy of the variables used.

9. How could network management be used to provide fault tolerance in a networkedrendering farm?

10. What aspects of a computer network require management?Issues grouped into: performance, configuration, security, accounting and fault man-agement.

11. With reference to the MIB description below:

dot3StatsTable OBJECT-TYPESYNTAX SEQUENCE OF Dot3StatsEntryMAX-ACCESS not-accessibleDESCRIPTION "Statistics for a collection of ethernet-like

interfaces attached to a particular system. There will be one rowin this table for each ethernet-like interface in the system."

::= { dot3 2 }dot3StatsEntry OBJECT-TYPE

SYNTAX Dot3StatsEntryDESCRIPTION "Statistics for a particular interface to an

ethernet-like medium."::= { dot3StatsTable 1 }

Dot3StatsEntry ::= SEQUENCE {dot3StatsIndex InterfaceIndex,dot3StatsAlignmentErrors Counter32,dot3StatsFCSErrors Counter32,dot3StatsLateCollisions Counter32 }

dot3StatsIndex OBJECT-TYPESYNTAX InterfaceIndexMAX-ACCESS read-onlyDESCRIPTION "An index value that uniquely identifies an

interface to an ethernet-like medium."::= { dot3StatsEntry 1 }

dot3StatsAlignmentErrors OBJECT-TYPE

Page 114: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

114 APPENDIX A. SOLUTIONS

SYNTAX Counter32MAX-ACCESS read-onlyDESCRIPTION "A count of frames received on a particular

interface that are not an integral number of octets in lengthand do not pass the FCS check."

::= { dot3StatsEntry 2 }dot3StatsFCSErrors OBJECT-TYPE

SYNTAX Counter32DESCRIPTION "A count of frames received on a particular

interface that are an integral number of octets in length but donot pass the FCS check."

::= { dot3StatsEntry 3 }

(a) Show the portion of the MIB tree described here for 802.3 (Ethernet).

dot3StatsTabledot3StatsEntrydot3StatsIndexdot3StatsAlignmentErrorsdot3StatsFCSErrors

(a) Why does the MIB specification include type information?To help with the encoding of the variables into a byte array for transmission overthe network. The ASN.1 syntax used here is translated into bytes using a con-vention known as BER, the Basic Encoding Rules (similar to serialization underJava).

(b) What would variables such as dot3StatsAlignmentErrors be used for in a networkmanagement system?Fault management, to watch for potential problems on the network. Performancemanagement to see if a significant amount of bandwidth is being wasted on dam-aged packets.

(c) What would the numeric path for the variable dot3StatsFCSErrors be (relative todot3)?dot3.2.1.3

(d) Why are some entries marked as not-accessible?They are not leaf nodes in the MIB tree and so are not actual variables but justnodes on the path to the variables.

(e) What network hardware manufacturers such as Cisco and Nortel do when theycreate a new device with additional facilities that can be monitored? In particular,how would existing management system become aware of this additional function-ality?Provide additional MIB entries (usually under a vendor specific node in the tree),and distribute it with the equipment. Management systems should be able to usethe values since there are only a small number of types of the various variables.

(f) What security features would you expect to find in the latest version of the SNMPspecification?Encryption of data. Secure authentication. Encrytion of passwords. Access controllists so that different portions of the MIB can be seen by different groups.

12. Almost anything: switches, routers, bridges, firewalls, servers, even workstations.

13. A sample of some of them:

Page 115: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.9. SOLUTIONS TO EXERCISES: SECTION 9.1 115

IP-MIB::ipForwarding.0 = INTEGER: forwarding(1)IP-MIB::ipDefaultTTL.0 = INTEGER: 255IP-MIB::ipInReceives.0 = Counter32: 1129354960IP-MIB::ipInHdrErrors.0 = Counter32: 166580IP-MIB::ipInAddrErrors.0 = Counter32: 0IP-MIB::ipForwDatagrams.0 = Counter32: 1140667982IP-MIB::ipInUnknownProtos.0 = Counter32: 0IP-MIB::ipInDiscards.0 = Counter32: 24341670IP-MIB::ipInDelivers.0 = Counter32: 381204IP-MIB::ipOutRequests.0 = Counter32: 306462IP-MIB::ipOutDiscards.0 = Counter32: 0IP-MIB::ipOutNoRoutes.0 = Counter32: 26IP-MIB::ipReasmTimeout.0 = INTEGER: 30IP-MIB::ipReasmReqds.0 = Counter32: 0IP-MIB::ipReasmOKs.0 = Counter32: 0IP-MIB::ipReasmFails.0 = Counter32: 0IP-MIB::ipFragOKs.0 = Counter32: 0IP-MIB::ipFragFails.0 = Counter32: 0IP-MIB::ipFragCreates.0 = Counter32: 0

14. Retrieving successive entries from the MIB stored on a particular agent. Sends GET-NEXT requests to the agent, and receives GETRESPONSE messages back.

15. Pros and cons: easier to work with if everything is in one place, but then becomes asingle point of failure.

16. Pros and cons: Both have their merits, network designer needs to set the trade-offbased on nature of the network.

A.9 Solutions to exercises: Section 9.11. Most operating systems lose all file access control if the machines are booted up with

a boot floppy containing a program that can interpret the values on the sectors of thehard drive, and reconstruct a view of the file system.

(a) Why can this sort of program not be used when the operating system is running?Most halfway-decent operating system run in kernel mode, and direct access to de-vices is restricted to kernel mode processes (hopefully only the operating system).Thus requests for sectors will be filtered through the operating systems securitymechanism which should not allow access to sectors containing sensitive systeminformation.

(b) Windows NT comes with a new type of file system for which documentation is noteasily available. Is this an adequate solution to this problem?No. Reverse engineering is a lengthy but viable alternative to documentation.Thus absence of documentation does not make a product secure. Liable to faults,and difficult to maintain, perhaps but not secure.

(c) How does the use of networked file servers alleviate this problem?Important, and sensitive file may be stored on disks on the file servers which can belocated separately from general use machines, with additional security measuressuch as a locked door.

2. Most server programs written in C make use of the string library to read in requestsfrom clients (possibly via the network). Most of these functions only specify the amount

Page 116: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

116 APPENDIX A. SOLUTIONS

of memory required after they have copied values into it. This allows clients to over-write portions of memory on the server, possibly altering the code for the server.

(a) How could this cause security problems.By changing the code for the server, one can make the server run any programone care to download, with the security level associated with the server. Thispermits one to performs other tasks which may further compromise security, suchas snooping, or retrieving the password file.

(b) Suggest ways in which this problem could be prevented.Either run all programs with very minimal security privileges, or make sure thatno buffer overruns occur.

(c) Is there any way to detect when a program has been corrupted in this way?It may be detectable in some situations: one can periodically check that the codefor the program is unchanged, or put magic numbers on the stack and detect ifthey get overwritten.

3. Unix provides the rlogin mechanism which allows users on specific machines to log into other machines without having to type in a password.

(a) In what circumstances would this be good for the security of a system.Passwords do not need to be transmitted over the network.

(b) In what circumstances would this be bad for the security of a system.Security is linked to machine address, and packets can be forged as coming fromthis address.

4. How does a firewall work? If you have a network that is connected to the Internet,where would you put a firewall?Usually between internal network and the Internet. For alternative scenarios, see thesection of Firewalls.

5. How are viruses transmitted through the Internet?In the form of executable files, which are downloaded (for example by ftp, or in e-mailmessages), and which are then run.

6. Consider a company which is selling images of fractals over the Internet. How shouldit make use of firewalls to prevent:

(a) Illegal use being made of its computation servers.(b) Illegal access to its archive of images on a HTTP server.

7. What is private-key data encryption?

8. Describe ways in which network security can be applied in E-commerce applications.

9. What sort of security measures are available during any transaction over the web?

10. An E-commerce company needs to ensure the security of its networks.

(a) Which operating system would be most suitable for the e-commerce servers. Mo-tivate your answer by describing the security architectures of the contending sys-tems.

(b) Design a secure network for the company. Show the network layout diagram andlist the security features of your design.

(c) Explain how the company can use RSA encryption to improve security.

Page 117: Exercises on Computer Networks and Networking...Chapter 2 Network Protocols 2.1 Exercises 1. Show the HTTP protocol, as used on the local network, in relation to the OSI model. Describe

A.9. SOLUTIONS TO EXERCISES: SECTION 9.1 117

11. Consider the vulnerabilities described in section ??.

(a) Are there any systems that are invulnerable to security related problems?(b) What steps would you take to securing a host/network?(c) How would you go about determining if your host/network security had been com-

promised?

12. The payload of the TELNET protocol consists of the ASCII text of a command linesession with another machine (the keystrokes sent from one side, and the responsesprinted from the other). What security problems could this pose?Anyone sniffing the network can view the entire session, including the keystrokes en-tered for any passwords (even if they are not echoed).

13. Other Internet protocols (such as HTTP, SMTP) also use ASCII text. What are thealternatives? What are the pros and cons of each approach?Either use a binary encoding, or encrypt the communication. ASCII is easy to test byhand, debug and understand. Binary makes it slightly less accessible, but still pos-sible to snoop. Encrypted provide security, but at the expense of extra overhead andcomplication of managing keys.

14. How can you find out what machines are connected to a network?Send them packets which may trigger a response, for example all machines with an IPprotocol layer will respond to ICMP echo request messages (ping).

15. How can you find out what services each machine is running?Create a TCP connection to the port corresponding to the service (by using a programsuch as telnet for example). TCP is obliged to terminate the 3-way handshake if noservice is available and sends a connection refused.

16. How can a packet filtering firewall prevent a network from revealing this information.It can block connection attempts to machines, so that the same (null) response is pro-vided regardless of whether the service is there or not.

17. What advantages are there to attacking the network from a machine within the net-work?The ability to sniff on the local LAN. One can see at least broadcast traffic which mayreveal more information. One is usually not restricted by a firewall. One has an addresswhich is implicitly more trusted than the address of an external machine.

18. Use end-to-end encryption on all communication.

19. Use firewalls to prevent packets entering the network if destined to any but a fewprivileged machines on the network.

20. In general it is difficult, because blocking all packets to this port number will sabotagereturn messages for any connection that happened randomly to choose 50000 as thelocal port number when communicating with an outside service.

21. Potential buffer overrun, overwriting of the stack frame and return address for thismethod.

22. Potential for overwriting any file owned by the user, including some that may grantlogin access to external users. The use of strlen is also dangerous if the message is notterminated as a string should be.


Recommended