1 / 14

FRTP Implementation

FRTP Implementation. SENDER. Create TCP socket & bind it to port no. specified. listen() for the Receiver to connect() and accept() when it does. Get information (data channel port on Receiver, rate, secondary NIC IP address) on this channel. Connect a UDP channel to Receiver. SENDER.

bevis
Download Presentation

FRTP Implementation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FRTP Implementation

  2. SENDER • Create TCP socket & bind it to port no. specified. • listen() for the Receiver to connect() and accept() when it does. • Get information (data channel port on Receiver, rate, secondary NIC IP address) on this channel. • Connect a UDP channel to Receiver.

  3. SENDER • Create a new thread (“network” thread NT) to handle data transfer; previous “disk” thread DT handles disk access. • DT open()s the file requested and calls send() to send the file block by block (7.86 MB each). • Insert this application buffer (a block of the file) into the sender buffer linked list. • Signal the condition variable m_SendDataCond; this informs the NT that new data is available to be sent.

  4. SENDERSender Buffer Sender buffer m_pLastBlk m_pCurrAckBlk m_pCurrSendBlk m_pBlock Contains: Pointer to data Pointer to next block Length of data Contains: Pointer to data Pointer to next block Length of data Contains: Pointer to data Pointer to next block Length of data Contains: Pointer to data Pointer to next block Length of data Block info. m_lCurrSendPnt m_lCurrAckPnt unACKed data

  5. SENDERSender Buffer • The sender buffer is an area of memory (default 40MB), blocks of which (usually 8MB) are written by the DT. • Each block of data has an associated Block info. structure, which has a pointer to its block, length of the block and a pointer to the next block info. structure. • There are pointers to the block info. structures of the first , last block, block from which the most recently ACKed data was sent and the block from which data was sent most recently (could be unACKed). Note that these need not always be 4 different pointer values (e.g. the most recent ACKed and unACKed data could have been sent from the same block). • There are offset values to track the offset of the most recently sent ACKed and unACKed data in the blocks.

  6. SENDERNetwork Thread NT • Record time: entertime • If entertime > next expiry time (EXP timer = 1 sec), call processfeedback() to add all unACKed packets to losslist. • If no data to send wait on condition variable m_SendDataCond. • Poll control channel. If control packets rxed call processfeedback(). Reset expiry time.

  7. SENDER Network Thread NT • If losslist is not empty, get first sequence no. in loss list. Read from buffer into data packet. • Else read new data from buffer into data packet. • Send the data packet on UDP channel. • Wait for the inter packet interval to finish.

  8. RECEIVER • Create a TCP socket and connect to the Sender. • Send data channel port, secondary NIC IP address on this channel. • Wait for Sender to connect on UDP socket. • Create a new “network” thread NT to handle data transfer to the network. Previous “disk” thread DT handles disk access.

  9. RECEIVER • DT calls recv() with pointer to where the received data should be written and length of data expected. • If requested length of ACKed data is available in protocol buffer recv() returns. Write this data into the file and go to previous step. • Else wait on condition variable m_RecvDataCond. Set m_bReadBuf variable.

  10. RECEIVERNetwork Thread NT • Initialize the next ACK and SYN times. • Check if m_bReadBuf is set. If set (=> DT is waiting for data), try to read requested amount of data from protocol buffer. • If requested amt. of ACKed data is available signal the condition variable m_RecvDataCond.

  11. RECEIVERNetwork Thread NT • Else call registerUserBuffer(). This function copies data from protocol buffer to user buffer. The copied data includes ACKed and unACKed data till m_lMaxOffset. • Check if ACK, ERR or SYN timers have expired and call feedback() to send them. • Assign the pointer where next received packet should be placed.

  12. RECEIVERNetwork Thread NT • Wait for a maximum of 100 uS to read a data packet from the UDP channel. • If no packet go back to step 2. • Find out offset of received packet seq. no. w.r.t. last ACKed packet. • If received packet is not the expected one, then it has been received into the wrong memory location. Copy it to correct position.

  13. RECEIVERNetwork Thread NT • If received seq. no. > expected seq. no. then packet(s) has been lost. Add lost packet seq. no. to losslist. Call feedback() to send ERR packet on TCP channel. • If received packet is not 1472B then add it to irregularPktList. • If received seq. no. > current largest seq. no. update largest seq. no.. Else remove received seq. no. from losslist. • Update next expected seq. no. and go to step 2.

  14. IMPROVEMENTS • Remove flow control window • Add the interface (function) to set port number, UDP buffer size, FRTP buffer size, packet size, and block size. • No multiple application-level buffers/ copies. • Implementation CPU utilization should be independent of other processes.

More Related