Mac802_16SS Class Reference

#include <mac-802_16.h>

Inheritance diagram for Mac802_16SS:

Mac802_16 List of all members.

Public Member Functions

 Mac802_16SS ()
 ~Mac802_16SS ()

Protected Member Functions

int command (int argc, const char *const *argv)

Private Member Functions

void BsMapHandler (Event *e)
void BsSyncHandler (Event *e)
void BsUcdHandler (Event *e)
void BsRngHandler (Event *e)
void BsSendHandler (Event *e)
void BsTokenHandler (Event *e)
void SSRngHandler (Event *e)
void SSSndTimerHandler (Event *e)
void SSReqTimerHandler (Event *e)
void sendUp (Packet *p)
void sendDown (Packet *p)
void Initialize_entry (char direction, char index)
void HandleMap (Packet *)
void HandleOutData (Packet *, char)
void SendData (Packet *, char)
int SendReq (char, Packet *)
void decide_frag (Packet *, char)
void send_frag_data (Packet *, char)
void fill_extended_header (int, Packet *, char)
void send_concat (Packet *, char)
void RecvFrame (Packet *, int)
void handle_indata (Packet *, char)
void handle_inmgmt (Packet *, char)
void SetDefaultFlow ()
void PhUnsupress (Packet *, char)
void ApplyPhs (Packet *, char)
void print_alloclist (char)
void print_short_map_list (Packet *Pkt)
void print_classifiers ()
void dump_stats ()
char classify (Packet *, char)
int check_concat_req (char)
int check_frag_req (u_int32_t, char)
int fill_piggyback_req (char)
void MarkUsedContentionSlots (int, char)
void turn_off_contention (char)
int back_off (char, Packet *)
void insert_sndlist (double, char)
void insert_reqlist (double, char)
void refresh_reqlist (char)
void reinsert_reqlist (char)
void insert_pkt (Packet *, char)
void UpdateAllocationTable (char)
void HandleOtherMgmt (Packet *)
void print_ssalloclist ()
void HandleOutMgmt (Packet *, char)
void FillPiggyReq (char, Packet *)
int FillPiggyExtHdr (char, Packet *, int)
void UpdateJitter (char)
int CanBeSent (aptr &, Packet *, char)
int CanUnicastReqBeSent (char)
int CanContentionReqBeSent (char)
int DataGrantPending (char)
int MapSentAfterReq (char)
int NumContentionSlots (char)
void USRateMeasure (char, Packet *)
void us_getupdatedtokens (char)
int look_at_queue (char)
int filterACKPackets (Packet *pkt, char tbindex)
int packetMatch (Packet *pkt1, Packet *pkt2)
double find_contention_slot (char, u_int32_t)
double timer_expiration (char, Packet *, int)
Packet * deque_pkt (char)
Packet * pkt_lookup (char tbindex, int i)
void dumpBWSS (char *fileName)
void dumpUGSJITTER (char, char *filename)
void dumpFinalSSStats (char *fileName)
void dump802_16QueueStats (char *fileName, int channelBW)
void dump802_16UtilStats (char *fileName, int channelDSBW, int channelUSBW)
int packetTrace (Packet *p, int direction)
int timingsTrace (Packet *p, int id)
int ugs_idle (char, EventType, Packet *)
int ugs_decision (char, EventType, Packet *)
int ugs_tosend (char, EventType, Packet *)
int ugs_waitformap (char, EventType, Packet *)
int rtpoll_idle (char, EventType, Packet *)
int rtpoll_decision (char, EventType, Packet *)
int rtpoll_tosend (char, EventType, Packet *)
int rtpoll_waitformap (char, EventType, Packet *)
int rtpoll_tosendreq (char, EventType, Packet *)
int ertpoll_idle (char, EventType, Packet *)
int ertpoll_decision (char, EventType, Packet *)
int ertpoll_tosend (char, EventType, Packet *)
int ertpoll_waitformap (char, EventType, Packet *)
int ertpoll_tosendreq (char, EventType, Packet *)
int nrtpoll_idle (char, EventType, Packet *)
int nrtpoll_decision (char, EventType, Packet *)
int nrtpoll_tosend (char, EventType, Packet *)
int nrtpoll_waitformap (char, EventType, Packet *)
int nrtpoll_tosendreq (char, EventType, Packet *)
int nrtpoll_reqsent (char, EventType, Packet *)
int nrtpoll_contention (char, EventType, Packet *)
int beffort_idle (char, EventType, Packet *)
int beffort_decision (char, EventType, Packet *)
int beffort_tosend (char, EventType, Packet *)
int beffort_waitformap (char, EventType, Packet *)
int beffort_tosendreq (char, EventType, Packet *)
int beffort_reqsent (char, EventType, Packet *)
int beffort_contention (char, EventType, Packet *)
int beffort_ratecheck (char, EventType, Packet *)
void FillErtPSPiggyReq (char, Packet *)
int SendErtPSReq (char, Packet *)

Private Attributes

RNG * rng_
SSRng802_16Timer mhSSRng_
SSServiceFlowSendTimer mhSSSend_
SSServiceFlowRequestTimer mhReq_
Packet * map_
char debug_ss
u_int32_t ss_id
u_char my_lan
u_char SizeUpFlowTable
upstream_sflow UpFlowTable [MAX_NUM_UPFLOWS_PERSS]
u_char SizeDownFlowTable
downstream_sflow DownFlowTable [MAX_NUM_DOWNFLOWS_PERSS]
u_char default_upstream_index_
u_char default_dstream_index_
u_int16_t priority
double rng_freq
int bs_addr
double map_acktime
u_int32_t total_num_frag
u_int32_t total_num_collisions
u_int32_t total_num_bkoff
u_int32_t total_collision_drops
u_int32_t total_queue_drops
sptr SndList
rptr ReqList
rptr tempReqList
int(Mac802_16SS::* UGSswitch [UGSSTATES])(char, EventType, Packet *)
int(Mac802_16SS::* RTPOLLswitch [RTPOLLSTATES])(char, EventType, Packet *)
int(Mac802_16SS::* ERTPOLLswitch [ERTPOLLSTATES])(char, EventType, Packet *)
int(Mac802_16SS::* NRTPOLLswitch [NRTPOLLSTATES])(char, EventType, Packet *)
int(Mac802_16SS::* BEFFORTswitch [BEFFORTSTATES])(char, EventType, Packet *)
Event rintr
double last_dmptime
int reqFlag
int reqFlagCounter

Friends

class SSRng802_16Timer
class SSServiceFlowSendTimer
class SSServiceFlowRequestTimer

Detailed Description

Mac802_16SS class


Constructor & Destructor Documentation

Mac802_16SS::Mac802_16SS (  ) 

Constructor Function

Mac802_16SS::~Mac802_16SS (  )  [inline]


Member Function Documentation

int Mac802_16SS::command ( int  argc,
const char *const *  argv 
) [protected]

Reimplemented from Mac802_16.

void Mac802_16SS::BsMapHandler ( Event *  e  )  [inline, private, virtual]

Reimplemented from Mac802_16.

void Mac802_16SS::BsSyncHandler ( Event *  e  )  [inline, private, virtual]

Reimplemented from Mac802_16.

void Mac802_16SS::BsUcdHandler ( Event *  e  )  [inline, private, virtual]

Reimplemented from Mac802_16.

void Mac802_16SS::BsRngHandler ( Event *  e  )  [inline, private, virtual]

Reimplemented from Mac802_16.

void Mac802_16SS::BsSendHandler ( Event *  e  )  [inline, private, virtual]

Reimplemented from Mac802_16.

void Mac802_16SS::BsTokenHandler ( Event *  e  )  [inline, private, virtual]

Reimplemented from Mac802_16.

void Mac802_16SS::SSRngHandler ( Event *  e  )  [private, virtual]

Reimplemented from Mac802_16.

void Mac802_16SS::SSSndTimerHandler ( Event *  e  )  [private, virtual]

Timer handler function

Reimplemented from Mac802_16.

void Mac802_16SS::SSReqTimerHandler ( Event *  e  )  [private, virtual]

Reimplemented from Mac802_16.

void Mac802_16SS::sendUp ( Packet *  p  )  [private]

So a packet has been received by the PHY, and we want to send it up to the 802_16 link...

void Mac802_16SS::sendDown ( Packet *  p  )  [private]

Send packets passed by LLC to physical layer..So, NO MAC level Management Messages will be sent via this fucntion

void Mac802_16SS::Initialize_entry ( char  direction,
char  index 
) [private]

void Mac802_16SS::HandleMap ( Packet *  p  )  [private]

This routine invokes every flow handler (in whatever state they are in) to process the map. If a flow sees an opportunity to send- it updates the SS's allocation table.

Parameters:
p The packet containing the MAP

void Mac802_16SS::HandleOutData ( Packet *  p,
char  tbindex 
) [private]

Packet enters the SM for respective flow from this function

void Mac802_16SS::SendData ( Packet *  ,
char   
) [private]

int Mac802_16SS::SendReq ( char  tbindex,
Packet *  p 
) [private]

This is called when the SS wants to send a request to the BS It is invoked off the REQ_TIMER thread. The routine check_concat_req(tbindex) is called to see if we can send a concat request. The routine also calls beffort_ratecheck to see if it is even allowed to request bandwidth yet (subject to rate control).

Parameters:
p This is the current packet that we want to send.
Returns:
A 0 if an error occurs and the request is not sent, else a 1.

void Mac802_16SS::decide_frag ( Packet *  p,
char  tbindex 
) [private]

This routine is called at the slot time that has been allocated as the beginning transmission time for this packet.

Parameters:
p frame (not concatonated)
tbindex index to US flow table

void Mac802_16SS::send_frag_data ( Packet *  p,
char  tbindex 
) [private]

This routine is called when the packet p is a part of a frag or must be sent as a frag.

Parameters:
p frame (not concatonated)
tbindex index to US flow table

void Mac802_16SS::fill_extended_header ( int  i,
Packet *  p,
char  tbindex 
) [private]

Parameters:
i if (i == 1) it's a fragment, else not.

void Mac802_16SS::send_concat ( Packet *  p,
char  tbindex 
) [private]

This is called by SendData when a concatonated frame is ready to be sent. The number to send depends on the grant size

Parameters:
p Packet to send
tbindex Flow ptr

void Mac802_16SS::RecvFrame ( Packet *  ,
int   
) [private, virtual]

Reimplemented from Mac802_16.

void Mac802_16SS::handle_indata ( Packet *  ,
char   
) [private]

void Mac802_16SS::handle_inmgmt ( Packet *  ,
char   
) [private]

void Mac802_16SS::SetDefaultFlow (  )  [private]

void Mac802_16SS::PhUnsupress ( Packet *  ,
char   
) [private]

void Mac802_16SS::ApplyPhs ( Packet *  ,
char   
) [private]

void Mac802_16SS::print_alloclist ( char   )  [private]

void Mac802_16SS::print_short_map_list ( Packet *  p  )  [private]

This method dumps all IE's associated with the map. The format: each MAP will begin with a code of 0 and have zero or more codes of 1,2,3.

Parameters:
p The packet that contains the map message

void Mac802_16SS::print_classifiers (  )  [private]

void Mac802_16SS::dump_stats (  )  [private]

char Mac802_16SS::classify ( Packet *  ,
char   
) [private]

int Mac802_16SS::check_concat_req ( char  tbindex  )  [private]

returns a 1 if there is at least one packet waiting in the queue AND concat is enabled.

int Mac802_16SS::check_frag_req ( u_int32_t  ,
char   
) [private]

int Mac802_16SS::fill_piggyback_req ( char   )  [private]

void Mac802_16SS::MarkUsedContentionSlots ( int  ,
char   
) [private]

void Mac802_16SS::turn_off_contention ( char   )  [private]

int Mac802_16SS::back_off ( char  ,
Packet *   
) [private]

void Mac802_16SS::insert_sndlist ( double  ,
char   
) [private]

void Mac802_16SS::insert_reqlist ( double  ,
char   
) [private]

void Mac802_16SS::refresh_reqlist ( char   )  [private]

void Mac802_16SS::reinsert_reqlist ( char   )  [private]

void Mac802_16SS::insert_pkt ( Packet *  ,
char   
) [private]

void Mac802_16SS::UpdateAllocationTable ( char  tbindex  )  [private]

This function updates the allocation table for a service-flow when a MAP is received

void Mac802_16SS::HandleOtherMgmt ( Packet *   )  [private]

void Mac802_16SS::print_ssalloclist (  )  [private]

void Mac802_16SS::HandleOutMgmt ( Packet *  ,
char   
) [private]

void Mac802_16SS::FillPiggyReq ( char  tbindex,
Packet *  p 
) [private]

This is called to see if a request can be piggybacked to this packet, p. Nothing happens if (len_queue(UpFlowTable[tbindex].packet_list) = 0). IF there is at least one packet in the queue, deque it and save it in the flow table: UpFlowTable[tbindex].pkt = deque_pkt(tbindex);

This routine pulls this next packet, sees how many slots are required and then calls

ratecheck_returnval = FillPiggyExtHdr(tbindex,p,slots);

This sets the current packet with a piggyback request for bandwidth for the next packet that was just dequeued

int Mac802_16SS::FillPiggyExtHdr ( char  ,
Packet *  ,
int   
) [private]

void Mac802_16SS::UpdateJitter ( char  tbindex  )  [private]

This is called whenever a MAP is received by a UGS flow. The statistic adds all error (scheduled allocation time from actual). Then the dumpUGSJitter method periodically obtains the mean jitter = runningJitter / samples

int Mac802_16SS::CanBeSent ( aptr ,
Packet *  ,
char   
) [private]

int Mac802_16SS::CanUnicastReqBeSent ( char   )  [private]

int Mac802_16SS::CanContentionReqBeSent ( char   )  [private]

int Mac802_16SS::DataGrantPending ( char   )  [private]

int Mac802_16SS::MapSentAfterReq ( char   )  [private]

int Mac802_16SS::NumContentionSlots ( char   )  [private]

void Mac802_16SS::USRateMeasure ( char  tbindex,
Packet *  p 
) [private]

This routine updates the available tokens subject to the BW rate taking into account the transmission of this packet.

void Mac802_16SS::us_getupdatedtokens ( char  tbindex  )  [private]

This routine computes the available tokens subject to BW rate limits.

int Mac802_16SS::look_at_queue ( char  tbindex  )  [private]

This routine is for debug purposes. It displays packets in the queue.

Parameters:
tbindex Indicates the service-flow entry to which the packet has been mapped

int Mac802_16SS::filterACKPackets ( Packet *  pkt,
char  tbindex 
) [private]

This routine is called only if you want to do ack filtering at a SS. Before the packet is inserted in the queue (to await upstream transmission) packets that are already in the queue are scanned. All older ACK packets for this TCP connection (identified by matching the flowid, src/dst addr/port) and with a seqno less than the seqno of this ACK are removed from the queue and the packets are freed.

Parameters:
pkt ptr to a packet that has arrived and is to be queued
tbindex Indicates the service-flow entry to which the packet has been mapped
Returns:
The number of ACK packets that are remmoved from the Queue.

int Mac802_16SS::packetMatch ( Packet *  pkt1,
Packet *  pkt2 
) [private]

This routine compares the 2 packets and sees it their flowid, src/dst addr/port all match. If so, they are from the same flow.

Parameters:
pkt1 : ptr to a one packet
pkt2 : ptr to the second packet
Returns:
a 1 is pkt2 and pkt1 are from the same flow. Else a 0.

double Mac802_16SS::find_contention_slot ( char  tbindex,
u_int32_t  num 
) [private]

Find the starting time of the 'num' contention slot

double Mac802_16SS::timer_expiration ( char  ,
Packet *  ,
int   
) [private]

Packet * Mac802_16SS::deque_pkt ( char   )  [private]

Packet * Mac802_16SS::pkt_lookup ( char  tbindex,
int  i 
) [private]

void Mac802_16SS::dumpBWSS ( char *  fileName  )  [private]

void Mac802_16SS::dumpUGSJITTER ( char  tbindex,
char *  outputFile 
) [private]

This is called periodically (as of 3/26/05 it is piggybacked off the dumpBWSS mechanism). It computes a jitter statistic based on stats gathered since the last time this method was called. Each time a UGS allocation is made, the jitter is updated. This running total of jitter is simply the difference between the scheduled allocation time (based on the UGS grant interval) and the actual.

void Mac802_16SS::dumpFinalSSStats ( char *  fileName  )  [private]

void Mac802_16SS::dump802_16QueueStats ( char *  outputFile,
int  channelBW 
) [private]

Is called via a tcl script to dump the queue length of The first upstream flow in the table

void Mac802_16SS::dump802_16UtilStats ( char *  fileName,
int  channelDSBW,
int  channelUSBW 
) [private]

int Mac802_16SS::packetTrace ( Packet *  p,
int  direction 
) [private]

Parameters:
p A 802_16 frame.
direction direction is 0 when sent DS and 1 when arrival at US.
Returns:
0 on success.

int Mac802_16SS::timingsTrace ( Packet *  p,
int  id 
) [private]

Parameters:
p A 802_16 frame
id The ID that goes in the first field of the trace line

int Mac802_16SS::ugs_idle ( char  tbindex,
EventType  e,
Packet *  p 
) [private]

Parameters:
tbindex denotes the service-flow entry on which packet has been mapped

int Mac802_16SS::ugs_decision ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::ugs_tosend ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::ugs_waitformap ( char  tbindex,
EventType  e,
Packet *  p 
) [private]

This is called when certain events occur while a UGS flow is waiting for a MAP.

int Mac802_16SS::rtpoll_idle ( char  tbindex,
EventType  e,
Packet *  p 
) [private]

Parameters:
tbindex denotes the service-flow entry on which packet has been mapped

int Mac802_16SS::rtpoll_decision ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::rtpoll_tosend ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::rtpoll_waitformap ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::rtpoll_tosendreq ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::ertpoll_idle ( char  tbindex,
EventType  e,
Packet *  p 
) [private]

Parameters:
tbindex denotes the service-flow entry on which packet has been mapped

int Mac802_16SS::ertpoll_decision ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::ertpoll_tosend ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::ertpoll_waitformap ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::ertpoll_tosendreq ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::nrtpoll_idle ( char  tbindex,
EventType  e,
Packet *  p 
) [private]

Parameters:
tbindex denotes the service-flow entry on which packet has been mapped

int Mac802_16SS::nrtpoll_decision ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::nrtpoll_tosend ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::nrtpoll_waitformap ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::nrtpoll_tosendreq ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::nrtpoll_reqsent ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::nrtpoll_contention ( char  tbindex,
EventType  e,
Packet *  p 
) [private]

Parameters:
p The frame that already has bee adjusted for all headers

int Mac802_16SS::beffort_idle ( char  tbindex,
EventType  e,
Packet *  p 
) [private]

Parameters:
tbindex denotes the service-flow entry on which packet has been mapped

int Mac802_16SS::beffort_decision ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::beffort_tosend ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::beffort_waitformap ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::beffort_tosendreq ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::beffort_reqsent ( char  ,
EventType  ,
Packet *   
) [private]

int Mac802_16SS::beffort_contention ( char  tbindex,
EventType  e,
Packet *  p 
) [private]

Parameters:
p The frame that already has been adjusted for all headers

int Mac802_16SS::beffort_ratecheck ( char  tbindex,
EventType  e,
Packet *  p 
) [private]

This is called at before sending a request for bandwidth (including a piggy req) to see if the rate control has provided enough tokens. The dshdr_.mac_param contains the number of slots in the request for the case of a REQ_TIMER. Normally this is 1 or 6 for a piggy request. For the case of a PIGGY_REQ, the exthrd_[].eh_data[1] is set to # slots requested.

Parameters:
e Specifies the asynch event that led to this invocation: REQ_TIMER, PIGGYBACK_REQ
Returns:
If 1, then can send, if -1, then can NOT send

void Mac802_16SS::FillErtPSPiggyReq ( char  tbindex,
Packet *  p 
) [private]

This is called to send a request piggybacked to packet p. The request informs the BS the new packet size of the ertPS service.

int Mac802_16SS::SendErtPSReq ( char  tbindex,
Packet *  p 
) [private]

This is called when the ertPS service wants to send a request to the BS. It is invoked off the REQ_TIMER thread. The request will inform the new packet size to the BS.

Parameters:
p This is the current packet that we want to send.
Returns:
0 if an error occurs and the request is not sent, else a 1.


Friends And Related Function Documentation

friend class SSRng802_16Timer [friend]

friend class SSServiceFlowSendTimer [friend]

friend class SSServiceFlowRequestTimer [friend]


Member Data Documentation

RNG* Mac802_16SS::rng_ [private]

SSRng802_16Timer Mac802_16SS::mhSSRng_ [private]

SSServiceFlowSendTimer Mac802_16SS::mhSSSend_ [private]

SSServiceFlowRequestTimer Mac802_16SS::mhReq_ [private]

Packet* Mac802_16SS::map_ [private]

char Mac802_16SS::debug_ss [private]

u_int32_t Mac802_16SS::ss_id [private]

u_char Mac802_16SS::my_lan [private]

u_char Mac802_16SS::SizeUpFlowTable [private]

struct upstream_sflow Mac802_16SS::UpFlowTable[MAX_NUM_UPFLOWS_PERSS] [private]

u_char Mac802_16SS::SizeDownFlowTable [private]

struct downstream_sflow Mac802_16SS::DownFlowTable[MAX_NUM_DOWNFLOWS_PERSS] [private]

u_char Mac802_16SS::default_upstream_index_ [private]

u_char Mac802_16SS::default_dstream_index_ [private]

u_int16_t Mac802_16SS::priority [private]

double Mac802_16SS::rng_freq [private]

int Mac802_16SS::bs_addr [private]

double Mac802_16SS::map_acktime [private]

u_int32_t Mac802_16SS::total_num_frag [private]

u_int32_t Mac802_16SS::total_num_collisions [private]

u_int32_t Mac802_16SS::total_num_bkoff [private]

u_int32_t Mac802_16SS::total_collision_drops [private]

u_int32_t Mac802_16SS::total_queue_drops [private]

sptr Mac802_16SS::SndList [private]

rptr Mac802_16SS::ReqList [private]

rptr Mac802_16SS::tempReqList [private]

int(Mac802_16SS::* Mac802_16SS::UGSswitch[UGSSTATES])(char, EventType, Packet *) [private]

int(Mac802_16SS::* Mac802_16SS::RTPOLLswitch[RTPOLLSTATES])(char, EventType, Packet *) [private]

int(Mac802_16SS::* Mac802_16SS::ERTPOLLswitch[ERTPOLLSTATES])(char, EventType, Packet *) [private]

int(Mac802_16SS::* Mac802_16SS::NRTPOLLswitch[NRTPOLLSTATES])(char, EventType, Packet *) [private]

int(Mac802_16SS::* Mac802_16SS::BEFFORTswitch[BEFFORTSTATES])(char, EventType, Packet *) [private]

Event Mac802_16SS::rintr [private]

double Mac802_16SS::last_dmptime [private]

int Mac802_16SS::reqFlag [private]

int Mac802_16SS::reqFlagCounter [private]


The documentation for this class was generated from the following files:
Generated on Fri Feb 8 16:42:37 2008 for WiMAX by  doxygen 1.5.1