Академический Документы
Профессиональный Документы
Культура Документы
Install Ubuntu, Wireshark. Using wire shark get source IP address, destination IP address,
source port number, destination port number.
Routers, on the other hand, operate at layer 3 of the OSI Model. A router is able to determine where to
send a packet using the Network ID within the Network layer header. It then uses the routing table to
determine the route to the destination host.
Router
Switch
Connecting two or more nodes in the
Used for
Function
data between home computers, and port can be manage, VLAN can create
Used in (LAN,
MAN, WAN)
Transmission
LAN, WAN
At Initial Level Broadcast then Uni- First broadcast; then unicast & multicast
Type
Data
Transmission
Packet
form
Layer
Ports
2/4/8
Device Type
Networking device
Table
LAN
as needed.
Frame (L2 Switch) Frame & Packet (L3
switch)
Data Link Layer. Network switches
operate at Layer 2 of the OSI model.
Switch is multi port Bridge. 24/48 ports
Active Device (With Software) &
Networking device
Switches use content accessible memory
by
ASIC
(Application
Specific
integrated chips).
Transmission
Mode
Broadcast
Domain
Definition
Full duplex
Half/Full duplex
In Router, every port has its own Switch has one broadcast domain
Broadcast domain.
[unless VLAN implemented]
A router is a networking device that A network switch is a computer
connects a local network to other networking device that is used to
local networks. At the Distribution connect many devices together on a
Layer of the network, routers direct computer
network.
switch
is
traffic and perform other functions considered more advanced than a hub
Category
Router
critical
to
efficient
operation.
Intelligent Device
Bandwidth sharing is
Device
Switch
network because a switch will on send msg to
device that needs or request it
Intelligent Device
Dynamic
bandwidth sharing for modular There is no sharing port can be 10, 100,
sharing
cable
interfaces.
The
Speed
(Wired)
Routing
Decision
NAT (Network
Address
Translation)
In a different network environment In a LAN environment, an L3 switch is
Faster
Features
Bandwidth
Linksys WRT54GL Juniper MX &
Examples
Address
used
for
transmission
Hamming code error Detection
Hamming codes can detect up to two-bit errors or correct one-bit errors without
detection of uncorrected errors. By contrast, the simple parity code cannot correct errors, and
can detect only an odd number of bits in error.
In the Hamming code, k parity bits are added to an n-bit data word, forming a new word of n + k bits.
The bit positions are numbered in sequence from 1 to n + k. Those positions numbered with powers of
two are reserved for the parity bits. The remaining bits are the data bits. The code can be used with
words of any length.
Consider, for example, the 8-bit
data word 11000100. We include four parity bits with this word and arrange the 12 bits as follows:
Bit position
1
10
11
12
P1
P2
P4
P8
10
11
12
When the 12 bits are read from memory, they are checked again for errors. The parity of the word is
checked over the same groups of bits, including their parity bits. The four check bits are evaluated as
follows:
C 1 = XOR of bits (1, 3, 5, 7, 9, 11)
C 2 = XOR of bits (2, 3, 6, 7, 10,11)
C 4 = XOR of bits (4, 5, 6, 7, 12)
C 8 = XOR of bits (8, 9, 10, 11, 12)
Suppose, if at the receiever side, the following bits have arrived
bit Positions:
1
10
11
12
0---No error
0--error bit1
0--error bit5
No Error
C8
C4
C2
C1
Error in bit 1
Error inBit 5
of
this
are
very
high
in
largernetworks.
Dijkstra can't be used in DVR because it requires a full database of the entire topology of the
network (or area). DVR protocols don't carry that.
Differences
Link State- sends small updates everywhere.
Distance Vector- sends entire table but only to neighbours.
Link State- router knows the entire topology.
Distance Vector- router only knows its neighbours.
Link State- is more robust and scalable.
Distance Vector-is less robust and scalable.
Link State- uses better metric like bandwidth and delay.
Distance Vector-used hop count.
Link State- is Dijkstra.
Distance Vector-is Bellman-Ford.
In ns2 802.11 MAC, the recv() function is only available. Why? What is send_timer() and
recv_timer function?
recv()-The recv() function is called whenever a packet is received from either an upper or
lower layer. The packet to be sent is received by the recv() function.recv() checks the direction field in
the packet header. If the direction is DOWN, meaning the packet came from an upper layer, the packet
is then passed on to the send() function and return from recv().
If the packet is received from a lower layer the network interface here, then the first check will be
skipped. At this point the phy has just received the first bit of the incoming packet, but the MAC cant
do anything with the packet until the whole packet is received. If the packet is received while the
MAC is currently transmitting another packet, then the received packet would be ignored meaning the
error flag in the packets header is set.If the MAC is not currently receiving any packets, then the rx
state is changed to RECV and checkBackoffTimer is called from setRxState(). Afterwards, the
incoming packet is assigned to pktRx and the receive timer is started for the txtime() of the packet.If
the MAC was already receiving a packet when this packet arrived, it will compare the received power
of the new packet with the old packet. If the power of the new packet is smaller than the old packet by
at least the capture threshold, the new packet will be ignored (captured) and the capture() function is
called. If the power levels of the two packets are too close though, there will be a collision and control
will transfer to collision(), which will drop the arriving packet. The original packet wont be dropped
until its reception is complete. Control will return to the MAC whenever the receive timer expires,
calling recvHandler(), which in turns goes right to recv timer().
send timer()
This function is called at the expiration of the mhSend . This timer expires after amount of
time calculated as timeout in the corresponding check function the expiration of this timer means
slightly different things depending on which kind of packet was sent. In a switch statement, the MAC
checks the value of tx state to find out the kind of packet that was most recently sent and then handles
each packet differently. If the last packetsent was an RTS, the expiration of the timer means a CTS
wasnt received, presumably because the RTS collided or the receiving node is deferring. The MAC
responds by attempting to retransmit the RTS in the function RetransmitRTS().
If the last packet sent was a CTS packet, the expiration of the timer means that no data packet
was received. This is an infrequent event occurring if the CTS packet collided or if the data packet
was in error. The MAC handles this by simply resetting itself to an idle state. This involves freeing the
CTS packet stored in pktCTRL .
If the last packet sent was a data packet, the expiration of the timer means that an ACK was
not received. The MAC handles this situation by calling RetransmitDATA().
Finally, if the last packet sent was an ACK, the expiration of the timer simply means that the ACK has
been transmitted, as no response is expected from an ACK. The MAC frees the ACK packet pointed
to by pkt CTRL .
After each case has been handled and a packet has possibly been prepared for retransmission, the
function tx resume() is given control. If a packet is going to be retransmitted, the backoff timer has
already been started with an increased contention window.
recv timer()
his is the receive timer handler, called when mhRecv expires (though indirectly though RecvHandler).
The expiration of the receive timer means that a packet has been fully received and can now be acted
upon.
The first thing the function does is assert that there is either a rx state equals MAC RECV or rx state
equals MAC COLL.
First, the MAC checks to see if its currently transmitting a packet by checking the flag, tx active . If
so, the MAC wouldnt not have even heard the packet so it is just discarded (without updating NAV)
and goto Done.
Next, the rx state is checked to see if there was a collision during this packet, rx state equals MAC
COLL. If so, then pktRx is the colliding packet that lasted longest and now needs to be discarded. The
NAV is also set for an eifs time, which is the amount of time the MAC must wait after a collision and
then goto Done.
The MAC then checks the packet for errors, and discards the packet if any were detected. Again, the
NAV is set for eifs time after the error packet is finished being received. The next check the MAC
performs is if the packet is actually destined for itself if not, the MAC updates the NAV for the value
in the duration field in the MAC header (not necessary just the txtime of the packet). This is of course
so that the MAC attempt to transmit while other nodes are using the channel.And finally, the last
check performed is address filtering, where all packets that are not destined for the current node are
discarded. The NAV would have already been updated so theres no need to do anything else with the
packet. Now the MAC decides what to do based on what kind of packet it just received. If the packet
is of MAC Type Management, its simply dropped. If its an RTS packet, recvRTS() is called, if CTS
or ACK, then recvCTS() or recvACK() is called. And not surprisingly, if its a data packet, then
recvDATA() is called. After this, pktRx is set to zero and control to given to rx resume().
Why CSMA/CD cannot be used on wireless LAN?
The physical characteristics of WiFi make it impossible and impractical for the CSMA/CD
mechanism to be used. This is due to CSMA/CDs nature of listening if the medium is free before
transmitting packets.
Using CSMA/CD, if a collision is detected on the medium, end-devices would have to wait a random
amount of time before they can start the retransmission process. For this reason, CSMA/CD works
well for wired networks.
In wireless networks, there is no way for the sender to detect collisions the same way CSMA/CD does
since the sender is only able to transmit and receive packets on the medium but is not able to sense
data traversing that medium.
Wireless transceivers can't send and receive on the same channel at the same time, so they can't detect
collisions. This is due to the fact that there's an incredible difference between send power (generally
around 100mw) and receive sensitivity (commonly around 0.01 to 0.0001mw). The sending would
cover up any possible chance of receiving a foreign signal, no chance of "Collision Detection".
On most wired networks the (like Ethernet) the voltage is around 1 to 2.5v; both sending and
receiving are roughly the same voltage. So if you're sending a 2.5v signal, and someone else collides
with a -2.5v signal, the "Detection" parts will see a signal somewhere around 0v and know a collision
occurred.
n a wired CSMA/CD Ethernet environment, it is possible to detect a collision because there are
separate TX and RX pairs (using the example of 10BaseT). If a half-duplex 10BaseT NIC sends a
frame on the TX pair, but sees that frame is corrupted on the RX pair, the NIC detected a collision.
However, with an 802.11 wireless device, there are no "conductors," just antennas which do not
simultaneously transmit and receive. When an 802.11 device is transmitting it cannot in practical
terms listen for another signal transmitting at the same time on the same frequency. The reason for this
is that RF signal strength drops off very quickly when transmitting.
Therefore, CSMA/CA is used on wireless networks. CSMA/CA doesnt detect collisions but rather
avoids them through the use of a control message. Should the control message collide with another
control message from another node, it means that the medium is not available for transmission and the
back-off algorithm needs to be applied before attempting retransmission.
Framing format used in HDLC and PPP.
PPP frame Format
On asynchronous link PPP uses character stuffing or byte stuffing and on synchronous link
PPP uses bit stuffing.
Point-to-Point Protocol (PPP) is a data link (layer 2) protocol used to establish a direct
connection between two nodes.
It can provide connection authentication, transmission encryption (using ECP, RFC 1968),
and compression.
Internet service providers (ISPs) have used PPP for customer dial-up access to the Internet,
since IP packets cannot be transmitted over a modem line on their own, without some data
link protocol.
Two derivatives of PPP, Point-to-Point Protocol over Ethernet (PPPoE) and Point-to-Point
Protocol over ATM (PPPoA), are used most commonly by Internet Service Providers (ISPs)
to establish a Digital Subscriber Line (DSL) Internet service connection with customers.
HDCL
On synchronous links, this is done with bit stuffing. Any time that 5 consecutive 1-bits appear
in the transmitted data, the data is paused and a 0-bit is transmitted.