Changes between Version 3 and Version 4 of Old/Documentation/OTG/FuncSpec/Gate


Ignore:
Timestamp:
Apr 4, 2006, 9:24:43 PM (19 years ago)
Author:
zhibinwu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/Documentation/OTG/FuncSpec/Gate

    v3 v4  
    33= Gate =
    44
    5 [source:otg/trunk/src/cpp/gate.h#latest Gate] is an abstract class for the interface to receive a packet, whether UDP, TCP Socket, or LIBMAC inteface.
    6 The most basic virtual funciton for a gate is defined here:
     5[source:otg/trunk/src/cpp/gate.h#latest Gate] is an abstract class for the interface to receive a packet, whether UDP, TCP Socket, or LIBMAC interface.
     6The most basic virtual function for a gate is defined here:
    77 * receivePacket
    8 Genereally, the OTR architrecture assume one OTR could have more than one gates. Each gate is bound to only one port number. Thus, if there are multiple ports used to receive packets, there are multiple gates. There is only one thread associated with each gate. One gate, one thread. The gate could have multiple flows, but unlike [source:otg/trunk/src/cpp/port.h#latest Port], "Gate" is in charge of reception, and ''Flow'' is passive, associated with one sender address.
     8Generally, the OTR architecture assume one OTR could have more than one gates. Each gate is bound to only one port number. Thus, if there are multiple ports used to receive packets, there are multiple gates. There is only one thread associated with each gate. One gate, one thread. The gate could have multiple flows, but unlike [source:otg/trunk/src/cpp/port.h#latest Port], "Gate" is in charge of reception, and ''Flow'' is passive, associated with one sender address.
    99
    1010[[Image(classGate.png)]]
    1111
    12 == Demultiplexing incoming packets ==
     12== De-multiplexing incoming packets ==
    1313
    1414A link table data structure is used to store the sender information of all received packets. Each entry of sender information is defined as a class [source:otg/trunk/src/cpp/flow.h#latest Flow].
     
    2828
    2929To initialize the Gate object, there are two functions need to be called.
    30  * '''init''': the implemenatation of this depends on different child classes.
     30 * '''init''': the implementation of this depends on different child classes.
    3131 * '''configGate''':  this is used to bind the Gate object to the [source:otg/trunk/src/cpp/orbitapp.h#latest OrbitApp] and [source:otg/trunk/src/cpp/sink.h#latest Sink] objects.
    32  * '''startReceive''': when a Gate thread (receiving thread) is initialzied by the OTR main function, this function is called to do final preparations.
     32 * '''startReceive''': when a Gate thread (receiving thread) is initialized by the OTR main function, this function is called to do final preparations.
    3333
    3434== Receive Operation ==
    3535''receivePacket'' is a virtual function for packet reception operation.
    36 In general, receivePacket are occured in a per-packet basis. After it is called, for TCP sockets, recv() functons. For UDP and RAW sockets, recvfrom() functions are used to receive data.
    37 It is in the default blocking socket mode. So, when ''recv'' and ''recvfrom'' socket functuon is called, unless some packets or bytes are retrieved, this thread is blocked.
     36In general, receivePacket are occurred in a per-packet basis. After it is called, for TCP sockets, recv() functions. For UDP and RAW sockets, recvfrom() functions are used to receive data.
     37It is in the default blocking socket mode. So, when ''recv'' and ''recvfrom'' socket function is called, unless some packets or bytes are retrieved, this thread is blocked.
    3838
    3939