assignment 2 cndc ii1 sol

28
Farrukh Naseem 2003-EE-045 COMPUTER NETWORKS & DATA COMMUNICATION – II CE-414 ASSIGNMENT # 2 Part I (Self Study) Q1. Discuss the term Multicasting. Briefly explain its practical uses applications in detail. Multicast is the delivery of information to a group of destinations simultaneously using the most efficient strategy to deliver the messages over each link of the network only once and only create copies when the links to the destinations split. USES: Multimedia: A number of users “tune in” to video or audio transmission from a multimedia source station. Teleconferencing: A group of workstations form a multicast group such that a transmission from any member is received by all other group members. Database: All copies of a replicated file or database are updated at the same time. Distributed computation: Intermediate results are sent to all participants. Real-time workgroup: Files, graphics, and messages are exchanged among active group members in real time.

Upload: api-3697683

Post on 11-Apr-2015

301 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

COMPUTER NETWORKS & DATA COMMUNICATION – II CE-414

ASSIGNMENT # 2

Part I (Self Study)

Q1. Discuss the term Multicasting. Briefly explain its practical uses

applications in detail.

Multicast is the delivery of information to a group of destinations simultaneously using the most

efficient strategy to deliver the messages over each link of the network only once and only create

copies when the links to the destinations split.

USES:

Multimedia: A number of users “tune in” to video or audio transmission from a multimedia

source station.

Teleconferencing: A group of workstations form a multicast group such that a transmission from

any member is received by all other group members.

Database: All copies of a replicated file or database are updated at the same time.

Distributed computation: Intermediate results are sent to all participants.

Real-time workgroup: Files, graphics, and messages are exchanged among active group

members in real time.

Q2. Briefly explain Broadcast, Multiple Uni-cast, True Multicast and

Multicast with the help of diagrammatic example.

Broadcast: Broadcast a copy of packet to each network and requires 13 copies of the packet.

Multiple Unicast: Send packet only to networks that have hosts in group and requires 11 copies

of the packet.

True Multicast: Determine least cost path to each network that has host in group. It also gives

spanning tree configuration containing networks with group members. It transmit single packet

Page 2: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

along spanning tree. The routers replicate packets at branch points of spanning tree and require 8

packets.

Page 3: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

Q3. What are the requirements for Multicasting? Illustrate your answer

with the help of a spanning tree example.

REQUIREMENTS:

• Router may have to forward more than one copy of packet

• Convention needed to identify multicast addresses

— IPv4 - Class D - start 1110

— IPv6 - 8 bit prefix, all 1, 4 bit flags field, 4 bit scope field, 112 bit group identifier

• Nodes must translate between IP multicast addresses and list of networks containing

group members

• Router must translate between IP multicast address and network multicast address

• Mechanism required for hosts to join and leave multicast group

• Routers must exchange info

• Which networks include members of given group

• Sufficient info to work out shortest path to each network

• Routing algorithm to work out shortest path

• Routers must determine routing paths based on source and destination addresses

Consider an example that the server transmits a packet with a multicast address that includes

hosts on N3, N5 and N6. What will C do when it receives a packet with such a multicast address?

A simple minded approach would be for C to calculate the shortest path to each of these three

Page 4: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

networks. This produces the shortest path spanning tree shown in figure. Now C will transmit

two copies out over N4 and one copy over N3.

Q4. Define and explain IGMPv3. Also explain its principle operations with

the comparison of IGMPv1 & IGMPv2.

The Internet Group Management Protocol (IGMP) is used by IPv4 systems (hosts and routers) to

report their IP multicast group memberships to any neighboring multicast routers. Note that an IP

multicast router may itself be a member of one or more multicast groups, in which case it

performs both the "multicast router part" of the protocol (to collect the membership information

needed by its multicast routing protocol) and the "group member part" of the protocol (to inform

itself and other, neighboring multicast routers of its memberships).

IGMP is also used for other IP multicast management functions, using message types other than

those used for group membership reporting. Hosts send messages to routers to subscribe to and

unsubscribe from multicast group. Routers check which multicast groups of interest to which

hosts.

IGMPv1 & IGMPv2:

Receivers have to subscribe to groups while the sources do not have to subscribe to groups and

any host can send traffic to any multicast group

Q5. Discuss IGMP Message Format. Discuss its types and fields in detail.

Illustrate your answer with the help of diagram also.

There are three type of message format of IGMP.

1) MEMBERSHIP QUERY

Page 5: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

It is sent by multicast routers. There are three subtypes: a general query, used to learn which

groups have members on an attached network; a group-specific query, used to learn if a

particular group has any members on an attached network: and a group-and-source specific

query, used to learn if any attached device desires reception of packets sent to a specific multicast

address from any of a specified list of sources.

MEMBERSHIP QUERY FIELD:

TYPE: Defines this message type.

MAX RESPONSE TIME: The Max Response Time field specifies the maximum time

allowed before sending a responding report. The actual time allowed, called the Max Response

Time, is represented in units of 1/10 second.

CHECKSUM: The Checksum is the 16-bit one's complement of the one's complement sum of

the whole IGMP message (the entire IP payload). For computing the checksum, the Checksum

field is set to zero. When receiving packets, the checksum MUST be verified before processing a

packet.

GROUP ADDRESS: The Group Address field is set to zero when sending a General Query,

and set to the IP multicast address being queried when sending a Group-Specific Query or

Group-and-Source-Specific Query.

Page 6: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

RESERVED FIELD: The Resv field is set to zero on transmission, and ignored on

reception.

S FLAG (Suppress Router-Side Processing): When set to one, the S Flag indicates to

any receiving multicast routers that they are to suppress the normal timer updates they perform

upon hearing a Query. It does not, however, suppress the querier election or the normal "host-

side" processing of a Query that a router may be required to perform as a consequence of itself

being a group member.

QRV (Querier's Robustness Variable): If non-zero, the QRV field contains the

[Robustness Variable] value used by the querier, i.e., the sender of the Query. If the querier's

[Robustness Variable] exceeds 7, the maximum value of the QRV field, the QRV is set to zero.

Routers adopt the QRV value from the most recently received Query as their own [Robustness

Variable] value, unless that most recently received QRV was zero, in which case the receivers

use the default [Robustness Variable] value.

QQIC (Querier's Query Interval Code): The Querier's Query Interval Code field

specifies the [Query Interval] used by the querier. The actual interval, called the Querier's Query

Interval (QQI), is represented in units of seconds. Multicast routers that are not the current

querier adopt the QQI value from the most recently received Query as their own [Query Interval]

value, unless that most recently received QQI was zero, in which case the receiving routers use

the default [Query Interval] value.

NUMBER OF SOURCES: The Number of Sources (N) field specifies how many source

addresses are present in the Query. This number is zero in a General Query or a Group-Specific

Query, and non-zero in a Group-and-Source-Specific Query.

SOURCE ADDRESS: One 32 bit unicast address for each source.

2) MEMBERSHIP REPORT:

Page 7: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

MEMBERSHIP REPORT FIELDS:

NUMBER OF GROUP RECORDS: The Number of Group Records (M) field specifies how

many Group Records are present in this Report.

GROUP RECORDS: Each Group Record is a block of fields containing information pertaining

to the sender's membership in a single multicast group on the interface from which the Report is

sent.

3) GROUP RECORD:

GROUP RECORD FIELDS:

RECORD TYPE: Defines this record type.

AUX DATA LENGTH: Length of the auxiliary data field, in 32-bit words.

NUMBER OF SOURCES: Specifies how many source addresses are present in this record.

MULTICAST ADDRESS: The IP multicast address to which this record pertains.

SOURCE ADDRESSES: If the number of sources is N, then there are N 32-bit unicast

addresses appended to the message.

AUXILIARY DATA: Additional information pertaining to this record.

Page 8: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

Q6. Discuss IGMP operation. Explain its Group Membership with IPV6.

In Multicasting, in order to receive multicast datagrams, a host must join a host group. When a

host is multi-homed, it may join any group on one or more of its interfaces (attached subnets).

The multicast messages that the host receives from the same group on two different subnets may

be different. For example 244.0.0.1 is the group for ``all hosts on this subnet'', so the messages

received on one subnet will always be different for this group from those on another. Multiple

processes on a single host may be listening for messages for a multicast group on a subnet. If this

is the case, the host joins the group once only, and keeps track internally of which processes are

interested in that group.

To join a group, the host sends a report on an interface. The report is addressed to the multicast

group of interest. Multicast routers on the same subnet receive the report and set a flag to indicate

that at least one host on that subnet is a member of that group. No host has to join the all hosts

group (224.0.0.1); membership is automatic. Multicast routers have to listen to all multicast

addresses (that is, all groups) in order to detect such reports. The alternatives would be to use

broadcasts for reports or to configure hosts with unicast addresses for multicast routers.

Multicast routers regularly, but infrequently (RFC 1112 mentions one-minute intervals), send out

a query to the all hosts multicast address. Each host which still wishes to be a member of one or

more group replies once for each group of interest (but never the all hosts group, since

membership is automatic). Each reply is sent after a random delay to ensure that IGMP does not

cause bursts of traffic on the subnet. Since routers do not care how many hosts are members of a

group and since all hosts which are members of that group can hear each other replying, any host

which hears another claim membership of a group will cancel any reply that it is due to send in

order to avoid wasting resources. If no hosts claim membership of a group within a specified

interval, the multicast router decides that no host is a member of the group. When a host or a

multicast router receives a multicast datagram, its action is dependent upon the TTL value and

the destination IP address.

0

A datagram sent with a TTL value of zero is restricted to the source host.

1

Page 9: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

A datagram with a TTL value of one reaches all hosts on the subnet which are members of the

group. Multicast routers decrement the value to zero, but unlike unicast datagrams, they do not

report this with an ICMP Time Exceeded message. Expiration of a multicast datagram is a

normal occurrence.

2+

All hosts which are members of the group and all multicast routers receive the datagram. The

action of the routers depends on the multicast group address.

224.0.0.0 - 224.0.0.255

This range is intended for single-hop multicasting applications only. Multicast routers will not

forward datagrams with destination IP addresses in this range. It may seem at first as though a

host need not bother reporting its membership of a group in this range since multicast routers will

not forward datagrams from other subnets. However, the report also informs other hosts on the

subnet that the reporting host is a member if the group. The only group which is never reported is

224.0.0.1 because all hosts know that the group consists of all hosts on that subnet.

Other datagrams with other values for the destination address are forwarded as normal by the

multicast router: it decrements the TTL value by at least one second as usual. This allows a host

to locate the nearest server which is listening on a multicast address using what is called an

expanding ring search. The host sends out a datagram with a TTL value of 1 (same subnet) and

waits for a reply. If none is received, it tries a TTL value of 2, then 3, and so on. Eventually it

will find the closest server.

GROUP MEMBERSHIP WITH IPv6

IGMP defined for IPv4 uses 32-bit addresses. IPv6 internet needs this same functionality. IGMP

functions have been incorporated into the new version of the Internet Control Message Protocol

version 6 (ICMPv6). ICMPv6 includes all of functionality of ICMPv4 and IGMP. ICMPv6

includes group-membership query and group-membership report message which are use in the

same fashion as in IGMP.

Page 10: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

Q7. Define and explain routing protocols. Shortly discuss Autonomous

Systems with the help of an example.

A generic term that refers to a formula, or protocol, used by a router to determine the appropriate

path over which data is transmitted. The routing protocol also specifies how routers in a network

share information with each other and report changes. The routing protocol enables a network to

make dynamic adjustments to its conditions, so routing decisions do not have to be

predetermined and static.

An Autonomous System (AS) is a group of networks under mutual administration that share the

same routing methodology. An AS uses an internal gateway protocol and common metrics to

route packets within the AS and uses an external gateway protocol to route packets to other

Autonomous Systems.An AS is a set of routers and networks managed by a single organization.

It consists of a group of routers exchanging information via a common routing protocol.

Interior routing protocol passes routing information between routers within AS and it needs

detailed model. Routers need some info about networks outside their AS, Exterior Router

Protocol (ERP) is used in such case. ERP supports summary information on reachability.

Q8. What are different approaches to routing? Explain them.

APPROACHES TO ROUTING DISTANCE-VECTOR:

Page 11: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

• Each node (router or host) exchange information with neighboring nodes

o Neighbors are both directly connected to same network

• First generation routing algorithm for ARPANET

• Node maintains vector of link costs for each directly attached network and distance and

next-hop vectors for each destination

• Used by Routing Information Protocol (RIP)

• Requires transmission of lots of information by each router

o Distance vector to all neighbors

o Contains estimated path cost to all networks in configuration

o Changes take long time to propagate

APPROACHES TO ROUTING LINK STATE:

• Designed to overcome drawbacks of distance-vector

• When router initialized, it determines link cost on each interface

• Advertises set of link costs to all other routers in topology

o Not just neighboring routers

• From then on, monitor link costs

o If significant change, router advertises new set of link costs

• Each router can construct topology of entire configuration

o Can calculate shortest path to each destination network

• Router constructs routing table, listing first hop to each destination

• Router does not use distributed routing algorithm

o Use any routing algorithm to determine shortest paths

o In practice, Dijkstra's algorithm

• Open shortest path first (OSPF) protocol uses link-state routing.

• Also second generation routing algorithm for ARPANET

Q9. Define and explain the following:

Page 12: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

BGP and its Functions

The Border Gateway Protocol (BGP) is an inter-Autonomous System routing protocol. It is built

on experience gained with EGP. The primary function of a

BGP speaking system is to exchange network reachability information with other BGP systems.

This network reachability information includes information on the list of Autonomous Systems

(ASs) that reachability information traverses. It is use with TCP/IP internets and is preferred EGP

of the Internet. Messages sent over TCP connections

o Open

o Update

o Keep alive

o Notification

Procedures

o Neighbor acquisition

o Neighbor reachability

o Network reachability

BGP Messages, attributes and Notification Message

MESSAGE TYPE:

Page 13: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

• Keep Alive

o To tell other routers that this router is still here

• Update

o Info about single routes through internet

o List of routes being withdrawn

o Includes path info

• Origin (IGP or EGP)

• AS_Path (list of AS traversed)

• Next_hop (IP address of boarder router)

• Multi_Exit_Disc (Info about routers internal to AS)

• Local_pref (Inform other routers within AS)

• Atomic_Aggregate, Aggregator (Uses address tree structure to reduce

amount of info needed)

• AS_Path

o Enables routing policy

• Avoid a particular AS

• Security

• Performance

• Quality

• Number of AS crossed

• Next_Hop

o Only a few routers implement BGP

• Responsible for informing outside routers of routes to other networks

in AS

NOTIFICATION MESSAGE:

• Message header error

• Authentication and syntax

• Open message error

• Syntax and option not recognized

Page 14: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

• Unacceptable hold time

• Update message error

• Syntax and validity errors

• Hold time expired

• Connection is closed

• Finite state machine error

• Cease

• Used to close a connection when there is no error

BGP Procedure

• Open TCP connection

• Send Open message

o Includes proposed hold time

• Receiver selects minimum of its hold time and that sent

o Max time between Keep alive and/or update messages

Q10. Explain BGP Routing Information Exchange with example.

• Within AS, router builds topology picture using IGP

• Router issues Update message to other routers outside AS using BGP

• These routers exchange info with other routers in other AS

• Routers must then decide best routes

Q11. Discuss OSPF Protocol in detail. Also explain a Sample Autonomous

System, Directed Graph of Autonomous System and the SPF Tree with the

help of diagrams.

OSPF is a link-state technology, as opposed to a distance vector technology such as

Routing Information Protocol (RIP). The OSPF protocol performs the two primary

functions of every routing protocol algorithm: path selection and path switching. The

Page 15: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

Internet Engineering Task Force (IETF) developed OSPF in 1988. OSPF is an Interior

Gateway Protocol (IGP), which means that it distributes routing information between

routers belonging to the same autonomous system. OSPF was written to address the

needs of large, scalable internetworks that RIP could not.

Speed of convergence—In large networks, RIP convergence can take several minutes as the

routing algorithm goes through a hold down and route-aging period. With OSPF, convergence is

faster than with RIP because routing changes are flooded immediately and are computed in

parallel.

Support for variable-length subnet masks (VLSMs) —OSPF & RIPver-2 supports subnet

masking, but RIPver1 cannot support VLSM

Network reachability—A RIP network that spans more than 15 hops (15 routers) is considered

unreachable. OSPF has virtually no reachability limitations.

Use of bandwidth—RIP broadcasts complete routing tables to all neighbor every 30 seconds.

OSPF send update when there is a change in the Network. (Note that OSPF sends updates every

30 minutes to ensure that all routers are synchronized.)

Method for path selection—RIP has no concept of network delays (interface delays) and link

costs. In RIP, routing decisions are based purely on hop count. OSPF uses a cost value, which for

Cisco routers is based on the speed of the connection. As with RIP and IGRP, OSPF also

provides support for equal-cost multipaths.

Page 16: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

The mapping is straight forward:

1) Two routers joined by a point-to-point link are represented in the graph as being directly

connected by a pair of edges, one in each direction. (e.g. routers 6 and 10).

2) When multiple routers are attached to a network (such as a LAN or packet-switching

network), the directed graph shows all routers bidirectionally connected to the network vertex.

(e.g., routers 1, 2, 3 and 4 all connect to network 3).

3) If a single router is attached to a network, the network will appear in the graph as a stub

connection (e.g. network 7)

4) An end system, called a host, can be directly connected to a router, in which case it is depicted

in the corresponding graph (e.g. host 1).

5) If a router is connected to other AS then the path cost to each network in the other system must

be obtained by some exterior router protocol (ERP). Each such network is represented on the

graph by a stub and an edge to the router with the known path cost (e.g. networks 12 through 15).

A cost is associated with the output side of each router interface. This cost us configurable by the

system admin. Arcs on the graph are labeled with the cost of the corresponding router out

interface. Arcs having no labeled cost have a cost of 0.

Page 17: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

The result of Router 6 is shown as a tree in above figure, with R6 as the root of the tree.

The tree gives the entire route t any destination network or host. However, only the next

hop to the destination is used in forwarding process.

Answer the following:

Q.1 Following is the TCP data gram Captured on a Network .Now Answer

the following Questions according to the information given

0400D9030003AB7600024CAE5010CCC00FF00000

1. Is this a data segment or a segment used in Handshaking for the

establishment of connection

Data segment

2. Is this the last segment to be delivered

Page 18: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

No

3. What is the sequence # of the segment

003AB760 or 3848032

4. Does this segment contain data, if so what is the data offset?

No

5. Is there any Urgent data in the segment, if so what is it’s urgent pointer

No

6. Is there any Acknowledgment in the segment, if so what is the

Acknowledgement number

Yes, 0024CAE5 or 2411237

7. What is the source port #

64

8. How much large data this segment, indicates, that it can receive.

52224 Bits.

9. The port addresses used in this segment are they well known ports. If so

what application they are assigned to.

Not well known ports

Page 19: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

10. Is the Push function valid

It’s invalid as there is no data present.

Q.2 Write and explain the differences between the Segmentation &

Fragmentation of data

SEGMENTATION

Segmentation is the term used to describe the process of chopping streams of data into smaller

chunks. Segmentation usually occurs fairly early in the communication process and it is almost

always software that performs the segmentation process. The segmentation process is performed

prior to transfer of data across a network or before storage on a peripheral device. Segmentation

is necessary because today's communication systems use what is called packetized

communication.

An example of segmentation would be when Transmission Control Protocol (TCP of TCP/IP

fame) chops an e-mail into a segments, encapsulates the segment with remote and local TCP port

numbers and then delivers the completed protocol data unit is passed from TCP to Internet

Protocol (IP) to be stamped with a sequence number, source and destination addresses added and

a checksum calculated.

FRAGMENTATION

Fragmentation is the process of chopping larger chunks of data into smaller chunks.

Fragmentation is usually performed at the hardware level, and when data is chopped into

fragments, it is referred to as a frame. Fragmentation occurs so that data can be transmitted across

a connection without overwhelming the memory buffers on either side of the connection.

Fragmentation allows for the coordination of data transmission amongst devices connected to a

common transmission medium.

Q.3 How the two connections on the same two machines for the same

applications are identified, or in other words differentiated from each

other, Explain.

Page 20: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045

Applications trying to use the same port numbers on one host are avoided by writing those

applications to request an available port from TCP/IP. Because this port number is dynamically

assigned, it may differ from one invocation of an application to the next.

Q.4 Is a deadlock possible using only a two-way handshake instead of a

three-way hand-shake? Give an example or prove otherwise.

Deadlocks are possible. For example, station A sends a SYN to B to open a connection. The

SYN then arrives at the destination station B and B acknowledges it by sending its own SYN

back to A. The acknowledging SYN is lost, but B is now open. B is expecting the sequence

numbers it negotiated with A to be used for transferring data. Now the same thing happens to B,

and both are open, but expecting different sequence numbers.

Q.5 Compare and explain the workings of UDP and TCP.

TCP (Transmission Control Protocol) is the most commonly used protocol on the Internet. The

reason for this is because TCP offers error correction. When the TCP protocol is used there is a

"guaranteed delivery." This is due largely in part to a method called "flow control." Flow control

determines when data needs to be re-sent, and stops the flow of data until previous packets are

successfully transferred. This works because if a packet of data is sent, a collision may occur.

When this happens, the client re-requests the packet from the server until the whole packet is

complete and is identical to its original. UDP (User Datagram Protocol) is anther commonly used

protocol on the Internet. However, UDP is never used to send important data such as WebPages,

database information, etc; UDP is commonly used for streaming audio and video. Streaming

media such as Windows Media audio files (.WMA) , Real Player (.RM), and others use UDP

because it offers speed! The reason UDP is faster than TCP is because there is no form of flow

control or error correction. The data sent over the Internet is affected by collisions, and errors

will be present. Remember that UDP is only concerned with speed. This is the main reason why

streaming media is not high quality.

Page 21: Assignment 2 CNDC II1 Sol

Farrukh Naseem 2003-EE-045