วันจันทร์ที่ 24 สิงหาคม พ.ศ. 2552

week 9 : Data link layer cont.

NRM - Normal response mode
Primary send command to secondary, secondary send response to Primary (It can send data, If Primary ask)
ABM - Asynchronous Balance mode
No Primary and Secondary (Problem : support just point to point)

HLCD
I-frame - first bit in control field is 0
(Pole and Final
If it send 1 and send from primary to secondary - call pole
If it send 1 and come from secondary - call final
but If it send 0 that mean don't want to use this bit)

S-frame - first 2 bit in control field is 1 0
(RR - receive ready, same as ASK
RNR - receiver not ready to receive next frame, just stop sending data
REJ(go-back-N ARQ) - reject
SREJ - selective reject)

U-frame - first 2 bit in control field is 1 1

Point to point Protocol (PPP)
use when access internet to house, use only U-frame
Byte stuffing - If want to send flag as a data have to use ESC to make that be data

Link Establishing - LCP
Authenticating - PAP, CHAP
Network layer establishment - IPCP
Network termination - IPCP
Link terminating - LCP

Factor affecting network efficiency
- circuit
- error control techniques
- protocol used
Efficiency of protocol in % = total number of info bits to be transmitted/total number of bits transmitted
(Bigger the message length, better the efficiency - If use very large frame, It will have more chance to get error/Maximum 1500)

วันจันทร์ที่ 17 สิงหาคม พ.ศ. 2552

week 8 : Data link layer cont.

Data link control
Automatic Repeat Request (ARQ)
- Stop and Wait ARQ(after sender send 1 frame of data then wait for receiver check it correct or not)
- Continuous ARQ (sender can send more than 1 frame, don't have to wait)

Stop and Wait ARQ
ACK - Acknowleadge (tell that data is correct and send the number of next frame)
NAK - Negative Acknowleage (tell that data is incorrect and tell the number of frame that sender need to send again)
If receiver lost data when it reply to sender and sender doesn't receive anything, it have to wait until time out and send data to receiver again.
In case delayed ACK, receiver can't reach sender before time out and sender send data again.
If receiver want to send data too, have to reply first then send it own data, use Piggybacking to fix it.

Go-Back-N ARQ
sender will send more than 1 frame at the time (1 2 3 4). If receiver tell sender that frame #2 error, sender have to send frame 2 3 4 again.
Can send just frame in window If no respond from receiver, it have to wait(can't send more frame) but receiver doesn't have to reply every frame
Size of the sender window must less than 2 power n (2 power n - 1), Size of the reciever window is always 1.

Data link protocol
- Message delineation (start of frame and end of frame)
- Frame length
- Frame field structure (How many field we use in frame?)

Synchronous Transmission photocols
- Bit oriented protocol (bit by bit)
- Byte count protocol (sender and receiver count number of byte)
- Byte oriented protocol (special character)

วันอังคารที่ 11 สิงหาคม พ.ศ. 2552

week 7 : Data link layer

Data link layer - moving data from one device to another device

Major functions of data link layer photocol
- Media Access Control (control that which computer can send data)
- Error Control (make sure that data send from node to another node correctly)
- Message Delineation (Identify the beginning and ending of message)

Media Access Control - make sure that 2 party not send at the same time
- Point to point half duplex links (can't send and receive at the same time)
- Multipoint configuration (more than 1 computer share link)

Main approaches
- controlled access
1 device that control point, to allow another device send data (Ex. token)
- contention based access
check medium that available or not before send data (collision : don't know that link free or not and send data. Have to wait the random of time if data get the small amount of number, can send data first )

Polling
- Roll call polling
use in mainframe computer, can send data when it is asked by server and send data to server. Don't have to call by order and spend a lot of time to polling.
- Hub polling
use token ring

Error Control
- Corrupted (data changed), the data reached the destination but incorrect
- Lost data, the data not reached the destination but loss data in somewhere

Major function
- Preventing errors (task of the human, have to check it by yourself)
- Detecting and Correcting errors (data link layer, use after human can't find error)

* In a single bit error, only one bit in the data unit has changed (noise just occur and disappear very fast)
* A burst error means that 2 or more bits in the data unit have changed (have to count error from starting point to ending point)

Error Detection
- Parity Checking (even and odd parity, parity not enough to check error) count number of 1 to check that it odd or even number

LRC - Longitudinal Redundancy Checking (98% error detection rate) the receiver may not know the error occur
1. find parity for each character
2. calculate LRC (except last line)
3. the last number of BCC calculate from all number in row BCC

Polynomial Checking
- checksum
- cyclic redundancy check (CRC)
if use n bit CRC, put n zero and divisor is n + 1 bits (more CRC bits, more detect the error)