1 CPSC 3600 section 002 HW #1 Solutions Fall 2017 Last revision: 9/29/2017 You must work on this homework individually !! Section 1 (40 points) Short Answer Questions Question 1.1 (5) List the layers from the OSI seven layer network model that apply in a TCP/IP network. Provide a 1sentence summary of each layer in a TCP/IP context. Solution: First 3 are necessary for full credit Application layer: Protocols at the top level of the stack specify how applications are to interact when they communicate. Transport layer: Protocols in the Transport layer provide for communication from an application program on one computer to an application program on another. Network layer- The Internet layer (referred to as Internet Protocol or IP) specifies how two computers communicate across a network. Link layer: While not formally a part of TCP/IP, the link layer applies in a TCP/IP network. The goal of TCP/IP is to operate over any link. The link layer deals with sending and receiving network packets between nodes that are directly connected. Physical: Again, not formally a part of TCP/IP but it applies in a network. The physical layer provides the rules and data formats that define the data communications over a particular transmission medium. Question 1.2 (5) Assume two nodes communicate directly over a physical layer. Explain the difference between the channel bandwidth and the baud rate in a context where the two nodes communicate directly over a physical layer. Solution: The term bandwidth has different definitions depending on the context. A ‘channel bandwidth’ might refer to the ‘analog bandwidth’. This corresponds to the ‘spectrum range’ of the communications channel. So it is the difference between the highest and lowest frequencies that can operate over the channel. Another way to state this is that the channel bandwidth is the fastest continuously oscillating signal that can be sent over the channel. It is measured in cycles per second or Hertz (hz). The baud rate is a measure of how the communications method actually uses the channel bandwidth. Therefore, the baud rate is the transmitter’s maximum signal rate. The baud rate will be at most the channel bandwidth. However, to ensure robust communications over possibly noisy channel conditions, the baud rate is likely lower than the channel
16
Embed
Section 1 (40 points) Short Answer Questions1 CPSC 3600 section 002 HW #1 Solutions Fall 2017 Last revision: 9/29/2017 You must work on this homework individually !! Section 1 (40
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
CPSC 3600 section 002 HW #1 Solutions
Fall 2017
Last revision: 9/29/2017
You must work on this homework individually !!
Section 1 (40 points) Short Answer Questions
Question 1.1 (5) List the layers from the OSI seven layer network model that apply in a
TCP/IP network. Provide a 1sentence summary of each layer in a TCP/IP context.
Solution: First 3 are necessary for full credit
Application layer: Protocols at the top level of the stack specify how applications
are to interact when they communicate.
Transport layer: Protocols in the Transport layer provide for communication from
an application program on one computer to an application program on another.
Network layer- The Internet layer (referred to as Internet Protocol or IP)
specifies how two computers communicate across a network.
Link layer: While not formally a part of TCP/IP, the link layer applies in a
TCP/IP network. The goal of TCP/IP is to operate over any link. The link layer
deals with sending and receiving network packets between nodes that are directly
connected.
Physical: Again, not formally a part of TCP/IP but it applies in a network. The
physical layer provides the rules and data formats that define the data
communications over a particular transmission medium.
Question 1.2 (5) Assume two nodes communicate directly over a physical layer. Explain
the difference between the channel bandwidth and the baud rate in a context where the
two nodes communicate directly over a physical layer.
Solution: The term bandwidth has different definitions depending on the context.
A ‘channel bandwidth’ might refer to the ‘analog bandwidth’. This corresponds to the
‘spectrum range’ of the communications channel. So it is the difference between the
highest and lowest frequencies that can operate over the channel. Another way to state
this is that the channel bandwidth is the fastest continuously oscillating signal that can be
sent over the channel. It is measured in cycles per second or Hertz (hz).
The baud rate is a measure of how the communications method actually uses the channel
bandwidth. Therefore, the baud rate is the transmitter’s maximum signal rate. The baud
rate will be at most the channel bandwidth. However, to ensure robust communications
over possibly noisy channel conditions, the baud rate is likely lower than the channel
2
bandwidth. A measure of the efficiency of a communications system is how close the
baud rate comes to the channel bandwidth.
The baud rate along with the number of bits that are ‘encoded’ in each information
symbol determines the maximum rate at which digital data can be transmitted and
received. This rate is referred to as the channel capacity or sometimes called the data
rate.
Data rate = baud * log2(#signal levels)
In general, the number of data bits that can be encoded is the log base 2 number of signal
levels. Let’s say the transmission is a simply voltage – of either positive voltage or a
negative voltage. There are 2 signal levels per symbol which encodes 1 bit of data. If
the transmission were able to provide 4 unique voltage levels (-5, -2, +2, +5), this
increases the number of data bits to 2.
Data bits Signals
0 0 -5
0 1 -2
1 0 +2
1 1 +5
N possible unique combinations of energy can map to log2(N) unique sequences of 1’s
and 0’s.
A more useful definition of data rate would be to modify the theoretic data rate to reflect
the rate at which link data can be transferred. This accounts for the physical layer
overhead which can be significant especially over wireless channels.
Bandwidth has a different meaning when the perspective is at network layers above the
physical layer. In the context of the physical layer, term bandwidth relates to the
spectral width of electromagnetic signals. In the context of data networks, the term
bandwidth quantifies the data rate that a network link or a network path can transfer.
Further complications arise in defining bandwidth related to the amount of the channel
capacity that is consumed by overhead.
Other variants of the bandwidth concept include:
Effective data rate: the physical layer data rate adjusted for the amount of
physical layer overhead.
Link rate: The rate at which a link layer protocol can send and receive data from
higher layers. This takes into account the link layer overhead.
Network bandwidth : the rate that a network can send and receive data.
Available bandwidth : A network (large or small) might not be able to provide to
a particular user all of capacity as there might be congestion, channel errors, or
3
network service provider policy limits. At a given time instant, the amount of
capacity that can be allocated to a user is referred to as the available bandwidth.
Throughput: This usually refers to the rate at which data can be transferred
between two endpoints. It might assume transport layer overhead (or not).
Goodput: To clearly limit the measure to application data, the term goodput can
be used.
Question 1.3 (5) New automobiles sold in the United States will soon be required to
support wireless communications using a form of WiFi. There are seven channels
available to support vehicle-to-vehicle communications. The bandwidth of each channel
is 10Mhz. In the ‘best conditions’, it uses a modulation/demodulation based on QAM-64
which uses 64 signal levels per symbol. What is the maximum data rate in these ‘best
conditions’ ? Please state any assumptions you might make for your answer. Hint:
look up the Nyquist theorem.
Solution:
The Nyquist theorem provides the best case theoretic data rate over a channel of a given
bandwidth when used with a particular modulation method.
Data rate: 2 B logK = 2 * 10Mhz * log k where k is the number of signal levels. (64 in
this case).
D = 20,000,000 * 6 = 120 Mbps
The theoretic data rate needs to be adjusted to account for overhead. For this example, the
maximum usable data rate is 27 Mbps.
Further, to account for the effects of possible bit errors caused by channel impairment,
the Shannon theorem specifies the maximum data rate that could be achieved over a
transmission system that experiences noise. The signal to noise ratio (SNR) is a measure
a receiver observes as it attempts to differentiate the signal (from the sender’s
transmission) that arrives at the receiver from noise.
C = B log2 (1 + S/N) where C is the effective limit on the channel capacity in bits per
second, B is the bandwidth, and S/N is the signal-to-noise ratio.
Question 1.4 (5) In a connected vehicle scenario as described in the previous question,
applications running on vehicles can chose to use higher order modulation (64QAM) or
lower order modulation (BPSK or QPSK). Why might a connected vehicle application
transmit application messages using a lower order modulation such as QPSK rather than
4
a higher order modulation (which offers higher data rates than lower modulations) such
as 64 QAM?
Solution:
While higher order modulations offer higher data rates, they become more sensitive to
noise and channel impairments. CV applications generally do not send lots of data and
do not need high data rates. Reliability, quantified by packet loss rates and robust
connectivity over longer distances, is much more important.
Question 1.5 (6) When transmitting a 32-bit 2’s complement integer in big-endian order,
when is the sign bit transmitted (relative to other bits in the 32bit Integer). Please state
any assumptions you make.
Solution: Remember, two’s complement uses the most significant bit as the sign. To
invert, invert each bit and add one.
As an example, an integer of value 2 in hex is: 0x00000002.
To find the negative (i.e., to invert) we invert each bit and add 1.
So an integer of value -2: 11111111 11111111 11111111 11111110 which in hex is
0xFFFFFFFE.
One a big endian, the most significant octet is sent first. How an octet is sent over a
physical medium is dependent on the medium. For a link such as an Ethernet, data in
octets are sent serially starting with the most significant bit. There are other physical
layers that are parallel in nature (anyone remember the parallel port on a PC ? ).
For an Ethernet, the sign bit is sent first
Question 1.6 (5) From the kurose text, Review question R12. In the 7th edition, this
question is on page 68 and begins “What advantage does a circuit-switched network
have…”
Solution:
A circuit-switched network can guarantee a certain amount of end-to-end bandwidth for
the duration of a call. Most packet-switched networks today (including the Internet) cannot
make any end-to-end guarantees for bandwidth. FDM requires sophisticated analog
hardware to shift signal into appropriate frequency bands.
5
Question 1.7 (10) From the Kurose text, review question R13. In the 7th edition, this
question is on page 68 and begins “Suppose users share a 2 Mbps link….”
a) 2 users can be supported because each user requires half of the link bandwidth.
b) Since each user requires 1Mbps when transmitting, if two or fewer users transmit
simultaneously, a maximum of 2Mbps will be required. Since the available
bandwidth of the shared link is 2Mbps, there will be no queuing delay before the
link. Whereas, if three users transmit simultaneously, the bandwidth required
will be 3Mbps which is more than the available bandwidth of the shared link. In
this case, there will be queuing delay before the link.
c) Probability that a given user is transmitting = 0.2
d) Different ways to do this. Easiest is to define three events (E1, E2, E3) to represent a
user transmitting. The P[Ei] is 0.2. Define an event E that represents when all three users
are transmitting. So the Event E is equivalent to E1&E2&E3.
P[E]=P[E1]P[E2]P[E3] which is 0.2*0.2*0.2 = 0.008
Another way to do this is to model the situation as a Bernoulli event. The event is if the
user is transmitting – it’s either yes or no. And the probability of a success(p) is 0.2. We
want the probability of 3 successes in 3 trials :
Probability that all three users are transmitting simultaneously = 333 13
3
pp
= (0.2)3 = 0.008.
Since the queue grows when all the users are transmitting, the fraction of time during
which the queue grows is equivalent to the probability that all three users are transmitting
simultaneously. This is 0.008.
Section 2 (30) Analyzing ping results
Use the ping program on your VM with one of the following hosts: 202.58.60.194 or
202.58.60.194. You can use any other host as long as it is located outside of the US
(or….to the best of your ability, you think it is located outside the US). Use traceroute
or other tools to help estimate the physical location. I’ll refer to the destination node as
the ‘server’. Please do these two parts of this question.
Question 2.1 (10 points)
6
Run ping between your VM and the server for at least 1 hour. Redirect standard
output to a file.
Do this twice. Once in the evening (normally the Internet’s busy time) and once
earlier in the day (or late at night). So you will collect two data files: ping1dat
and ping2.dat.
Ping invocation example (NOTE: this involves a very short path- you are to
find/use a path that goes outside the US): ‘ping -D 152.1.0.36> ping1.dat’
o Specify the destination address as an IPV4 address in dotted decimal
notation.
o Specify the –D parameter so that a timestamp is appended to each sample
Results:
o Copy and paste the ping summary statistics to your homework submission.
o Copy and paste the results from traceroute to your homework submission.
Run ‘traceroute server’, if that does not appear to work, try ‘sudo traceroute –I
server’. Cut and paste your results to your homework submission. The purpose
is simply to verify that the path between the ping program endpoints appears to
be outside the US.
Example result ‘traceroute –I 152.1.0.36’ (Running traceroute 152.1.0.36 does
not work- just see wildcards for 64 iterations before giving up). Note- you can
also ask traceroute to show the domain name of each router- this might give
further clues as to if the path travels outside the US. traceroute to www1.csc.ncsu.edu (152.1.0.36), 64 hops max
o 1 10.0.2.2 0.005ms 0.003ms 0.002ms
o 2 130.127.3.114 14.690ms 25.637ms 15.252ms
o 3 130.127.3.6 13.278ms 17.736ms 18.978ms
o 4 205.186.62.9 19.742ms 14.194ms 15.338ms
o 5 205.186.63.2 18.224ms 15.144ms 31.125ms
o 6 143.215.193.2 17.234ms 15.278ms 16.049ms
o 7 198.71.46.170 22.189ms 38.032ms 22.835ms
o 8 128.109.9.217 25.090ms 24.523ms 26.389ms
o 9 128.109.18.110 26.197ms 24.992ms 30.577ms
o 10 152.1.6.253 27.822ms 28.429ms 27.553ms
o 11 * * *
o 12 * * *
o 13 152.1.0.36 43.842ms 39.613ms 32.689ms
We can interpret the traceroute result as follows
o There are at least 13 hops between my VM and the server.
o Each traceroute line shows the response from the next hop router. By
default, traceroute contacts each router (hop by hop) three times.
The three times in each line represent the RTT from the three contact
attempts with the router.
o We do see an increase in the avg RTT as we move further away from
the client. Not that sometimes we might see a hop reflect a larger
RTT than the next hop router. This usually is due to the fact that
some routers handle packets that require special processing (such as
7
when the traceroute client contacts the router) on a low priority basis.
Routers typically give priority to forwarding traffic and then respond
to IP control/signaling messages such as ICMP or IP options at a
lower priority.
o The asterisks at hops 11 and 12 are probably due to a firewall rule.
Solution:
Performed ‘ping –D 202.58.60.194 > ping1.dat ‘ two times.
The first result is from a session during the early afternoon
-- 202.58.60.194 ping statistics ---
8880 packets transmitted, 8857 received, 0% packet loss, time 8893241ms
rtt min/avg/max/mdev = 236.538/244.049/500.643/8.191 ms
The second result was from an evening. The evening session experienced packet loss-
there were errors in the output file indicating that the client received ICMP error
messages of ‘Destination Host Unreachable’ and ‘Destination Network Unreachable’.
These might be due to network failures caused by routing or at the destination endpoint.
Note that the Host Unreachable message contains a private IP network. If you do
traceroute every couple of hours you are likely to see frequent path changes.
1504274996.726364] 64 bytes from 202.58.60.194: icmp_seq=5393 ttl=230 time=246 ms
[1504275010.528146] From 100.46.135.149 icmp_seq=5406 Destination Host Unreachable
[1504275019.527775] From 100.46.135.149 icmp_seq=5415 Destination Host Unreachable
[1504275025.105811] From 100.46.135.149 icmp_seq=5421 Destination Host Unreachable
[1504275025.648658] From 10.0.2.2 icmp_seq=5422 Destination Net Unreachable
[1504275026.899616] 64 bytes from 202.58.60.194: icmp_seq=5423 ttl=230 time=250 ms
[1504275031.926017] 64 bytes from 202.58.60.194: icmp_seq=5428 ttl=230 time=250 ms
[1504275032.927065] 64 bytes from 202.58.60.194: icmp_seq=5429 ttl=230 time=250 ms
[1504275033.929318] 64 bytes from 202.58.60.194: icmp_seq=5430 ttl=230 time=250 ms
[1504275034.930107] 64 bytes from 202.58.60.194: icmp_seq=5431 ttl=230 time=250 ms
[1504275035.931633] 64 bytes from 202.58.60.194: icmp_seq=5432 ttl=230 time=250 ms
[1504275036.934427] 64 bytes from 202.58.60.194: icmp_seq=5433 ttl=230 time=251 ms
[1504275049.528221] From 192.168.5.177 icmp_seq=5445 Destination Host Unreachable
[1504275054.531201] From 192.168.5.177 icmp_seq=5450 Destination Host Unreachable
[1504275055.056962] 64 bytes from 202.58.60.194: icmp_seq=5451 ttl=230 time=250 ms
Results from traceroute:
traceroute -I --resolve-hostnames 202.58.60.194
traceroute to 202.58.60.194 (202.58.60.194), 64 hops max