Anda di halaman 1dari 8

July 2007

Assignment #4
Networking, Software Engg., Databases
Due date: 06-08-2007
1. Short answer type:
1.01 Let us consider an IP packet transmitted on an Ethernet. Is it possible
that the destination MAC address in the packet is different from the
MAC address of the destination?
Ans- Since mapping is done by router, thus some times it may happen
that router is unaware of the changes and packet with different IP address
can be delivered to another MAC address machine.

1.02 A router receives an IP packet on one of its Ethernet interfaces. How


can it determine the Ethernet connected system that just sent the
packet?

Ans- when ever a new connection is established and new packet arrives,
entry is made in the routing table in router. When a router receives any IP
packet it checks in its routing table which is dynamically updated by the all
the host connected to it so if entry exists in the table that means that
Ethernet

1.03 How many IP addresses does an IP router have?

Ans- Both wired and wireless routers possess two IP addresses, one for
internal home computer networking and one for the external Internet
connection.

1.04 Does a bridge need an IP address?

Ans- No, a bridge is a Data Link layer device, thus it doesn’t need an IP
address, it uses MAC address to forward the packet to the network.

1.05 Why do bridges have to build a spanning tree whereas routers do


not?
Ans- When two bridges are used to interconnect the same two computer
network segments, spanning tree is a protocol that allows the bridges to
exchange information so that only one of them will handle a given
message that is being sent between two computers within the network.
The spanning tree protocol prevents the condition known as a bridge loop.
This is not in case of routers because routers maintain a table to map the
packets to their destinations.

1.06 What do you understand by the term encapsulation with regards to


data communications protocols? How are TCP segments transported
across a LAN?
Ans- The encapsulation in terms of data communication protocols
interprets that in case of Virtual Private Network (VPN) we hide data
packets into the another IP packet and at the receiver end we extract out
the external packet and fetches the original data this is also known as
tunneling.

1.07 Define software engineering.


Ans:-Software engineering is the application of a systematic, disciplined,
quantifiable approach to the development, operation, and maintenance of
software

1.08 What metrics are there for object-oriented systems?


Ans:-
METRIC 1: Cyclomatic Complexity (CC)
METRIC 2: Line Count ==> Size/Documentation
METRIC 3: Comment Percentage
METRIC 4: Weighted Methods per Class (WMC)
METRIC 5: Response for a Class (RFC)
METRIC 6: Lack of Cohesion of Methods (LCOM)
METRIC 7: Coupling Between Object Classes (CBO)
METRIC 8: Depth of Inheritance Tree (DIT)
METRIC 9: Number of Children (NOC)

1.09 What is a bug?


Ans:- A software bug (or "bug") is an error, flaw, mistake, failure, or fault in
a computer program that prevents it from behaving as intended (e.g.,
producing an incorrect result). Most bugs arise from mistakes and errors
made by people in either a program's source code or its design, and a few
are caused by compilers producing incorrect code

1.10 Compare waterfall model with spiral model.


Ans:-
Water Fall Model Spiral Model
1. The least flexible and most obsolete 1. The spiral model is the most generic
of the life cycle models. of the models. Most life cycle models
2.Well suited to projects that has low can be derived as special cases of
risk in the areas of user interface and the spiral model.
performance requirements, but high 2.The spiral uses a risk management
risk in budget and schedule approach to software development.
predictability and control.
3.The pure waterfall performs well for 3. For projects with risky elements, it's
products with clearly understood beneficial to run a series of risk-
requirements or when working with reduction iterations which can be
well understood technical tools, followed by a waterfall or other non-
architectures and infrastructures. risk-based lifecycle.
2. State true of false with justification:
2.1 On a full duplex Ethernet link, there is no CSMA/CD protocol.
Ans- True
Because on full duplex Ethernet link there is separate link for transmission
and reception hence no collision so no CSMA/CD protocol

2.2 When a bridge has a packet ready to send on a half-duplex Ethernet


port, it listens to the medium and waits until the medium is idle.

Ans- True
Because in half-duplex channel there is single channel for reception and
transmission so to transmit bridge has to wait till medium is idle to avoid
collision.

2.3 In a bridged LAN with more than one bridge and with redundant
paths, packet sequence is not guaranteed.

Ans:- True
To avoid this problem spanning tree algo is used
2.4 When an IP router between two Ethernet segments forwards an IP
packet, it does not modify the destination IP address.
Ans- True
Because when IP router routs the packet it adds an additional header i.e.
encapsulation hence it sets destination address as the IP address of
neighboring IP router but not of the original packet’s destination IP
address.

2.5 The route indicated by traceroute may not be the real one because
parallel paths may exist in the Internet.

Ans:- True
It may possible when proxy servers are enabled

2.6 When a router sends a packet towards the final destination over a full
duplex Ethernet interface, it should put as destination MAC address
the MAC address of the next hop.
Ans- False
Because IP router does not deal with MAC address.

2.7Assume host A sends data to host B using a TCP socket. If A writes


three blocks of data into the TCP socket, then there will be three
packets sent to B.
Ans- False
Because the packet size can vary as per the capacity of the medium so it
is not necessary that same no. of packets received at receiving as at
sending end but the amount of data will be remain if there is no
transmission loss.
2.8 If an IP host A receives an IP packet with TTL=255, then A can
conclude that the source of the packet is on-link.
Ans- True
Because the maximum value of TTL is 255 and it is decremented by 1
when packet passes through the hop since it is received as TTL =255 that
means source of the packet is on the link.
2.9 In an intranet with more than one router, packet sequence is
guaranteed by means of the TTL field.
Ans- False
Because TTL (time to live)field is used to determine the hop count up to
which it can traverse for sequencing the sequence number field is used.
2.10 The subnet mask is used by a host or a router in order to know
whether it belongs to the same subnet as a machine identified by
some IP address.
Ans- True
Because the subnet mask is used for making hierarchy in the address to
utilize the IP address range more properly i.e. subnetting and by the help
of subnet mask it can be uniquely identified that whether the system is
belong to the same subnet or not.

3. Do as indicated:
3.01 Consider two hosts, A and B that are connected by a transmission
link of 1.4 Mbps. A packet length is (conveniently) 1.4 Kb (Kilobits).
The length of the link is 100Km.
What is the propagation delay from A to B - the amount of time from
when the first bit of the packet is transmitted at A, until it is received
at B?
What is the transmission time of the packet at A (the time from when
the first bit of the packet is sent into the wire, and the time at which
thelast bit is sent into the wire)
Suppose now that that length of the link is doubled. What is the
propagation delay from A to B now?
Returning to the case that the distance between A and B is 100Km,
how long must a packet be so that the receiver in receiving the first
bit at the same time that the sender is sending the last bit?

Ans:-
Propagation Delay
Delay =Link length/ cmedium
= 100km/200000km/ s
= 1/2000s
=0.5ms
Transmission time (serialization delay)
Delay = Packet length/Capacity
= 1.4 Kb/1.4 Mb/ s
= 1.4 Kb/1400 Kb/ s
= 1/1000s
= 1 ms

Double-length-link propagation delay


Delay = 2*0.5 ms
= 1 ms

Full link packet length


Packet length = Capacity*Propagation delay
= 1.4 Mbps*0.5ms
= 700 bit

3.02 Suppose the following three bytes of data: 10010010, 01010101,


10000001. (i) What is the checksum for these three bytes (note that
although the Internet checksum is computed using 16-bit summands,
you are being asked to compute this using 8-bit summands)? (ii) Show
(by introducing bit errors into the three bytes given earlier) two single
bit errors in the summands can be detected by the checksum. (iii)
Show another example where two single bit errors in the summands
can not be detected by the checksum.
Ans:-
(i)To compute the checksum we first need to add the three bytes:
10010010
01010101
10000001 +
--------------
01101001
We then take the 1-complement of the results as the checksum, which
is:
10010110

(ii)If we receive the following bytes: 00010010 01010100 10000001 we


have as a resulting checksum the value 00011000 which is different
than the received checksum (the one calculated in i) so we can detect
the errors.

(iii)If we receive the following bytes: 10010011 01010100 10000001 we


have as a resulting checksum the same as in case (i) and the error
remains undetectable
4.
5. Databases
4.01 Omega Credit, a corporate banking organisation, has decided to
develop a database to support its retail banking operations.

The database is going to store information about bank accounts,


customers and various kinds of cards that may be given to customers
in connection with these accounts. The accounts currently available
from Omega Credit include student accounts, instant access
accounts and credit accounts. All these accounts have a unique
account code. Furthermore, their owners may be given cash, charge,
or credit cards. All these kinds of cards have a unique card number
and a unique personal identification number (PIN). The name,
address and telephone number of any account owner need to be
known to Omega Credit at any instance of time. Student and instant
accounts have a balance indicating the funds currently in them. Only
customers who are students may own student accounts. A student
account has a single owner. The owner of student account is given a
cash card that can be used to withdraw money from the account
using any of the cash dispensers installed by Omega Credit.
Withdrawing cash from a student account carries no charges. Instant
access accounts may be owned by one or more customers jointly.
Each of the owners of these accounts may be given a cash or a
charge (debit) card or both. Similarly to student accounts, customers
are not charged for withdrawing cash from an instant account. Credit
accounts have a credit limit. They also have a balance indicating the
credit used at any instance of time. Like instant accounts, credit
accounts may be owned by one or more customers jointly. Each of
these owners is given a credit card. When a customer withdraws
cash from a credit account a handling charge of 1.5% is made on the
amount of the cash advance subject to a minimum of £1.50.

Design an ERD for this database. Your ERD should specify keys,
mapping cardinalities, participation constraints and existential
dependencies (if necessary). In cases where the above description of
the database is ambiguous, state clearly the assumptions justifying
your modelling choices.
4.02 The database of a travel agency includes the following relations
(primary keys are underlined):
Flight (FlightCode, AirlineName, FromAirport, DestAirport, Date,
DepartureTime, NoOfAvailSeats)
Prices (FlightCode, EconomyFare, BusinessFare)
Passenger (PassengerCode, Name, Address, Telephone)
Bookings (BookingRefNo, PassengerCode, FlightCode, Deposit,
TotalFare)

Specify the following queries in SQL:


(i) Find the codes of the flights from London to Athens
scheduled for the 29th of March 1999 which still have
available seats.
select FlightCode from Flight where (FromAirport =
'London') and (DestAirport = 'Athens') and (NoOfAvailSeats > 0)
and (Date = '29-mar-99')
(ii) Find the names of the passengers who have booked tickets
for the flight with code BA777 and have not paid the full fare
of their tickets yet.
select Name from Passenger, Bookings where
(Passenger.PassengerCode = Bookings.PassengerCode) and
(TotalFare > Deposit) and FlightCode = 'BA777')
(iii) Find the code, the airline operator and the departure time of
the flight with the cheapest economy fare from London to
New Delhi on the 6th of April 1999.
select Flight.FlightCode, AirlineName, DepartureTime from
Flight, Prices where (Flight.FlightCode = Prices.FlightCode) and
(FromAirport = 'London') and (DestAirport = 'New Delhi') and (Date
= '06-apr-99'))

(iv) Find the names of the passengers that have booked tickets on
British Airways flights from London to Paris from the 1st of April
1999 until the 30th of June 1999.
select Name from Passenger, Bookings, Flight
where (AirlineName = 'British Airways') and (FromAirport =
'London') and (DestAirport = 'Paris') and (Date £ '30-jun-99') and
(Date ³ '1-apr-99') and (Flight.FlightCode = Bookings.FlightCode)
and (Passenger.PassengerCode = Bookings.PassengerCode)

(v) Find the reference number of the booking that George


Spanoudakis has made for a Virgin Atlantic flight from London to
Boston on the 3rd of April 1999.
select BookingRefNo from Passenger, Bookings, Flight
where (AirlineName = 'VirginAtlantic') and (FromAirport =
'London') and (DestAirport = 'Boston') and (Date = '03-apr-99') and
(Name = 'George Spanoudakis') and (Flight.FlightCode =
Bookings.FlightCode) and (Passenger.PassengerCode =
Bookings.PassengerCode)

Anda mungkin juga menyukai