J-Sim v1.2.1-p7 API

drcl.inet.contract
Class PktSending

java.lang.Object
  extended bydrcl.comp.Contract
      extended bydrcl.inet.contract.PktSending

public class PktSending
extends Contract

The packet sending contract. This constract defines three packet sending services at the reactor:

DefaultForwarding
The initiator sends an InetPacket. Upon receipt of such a packet, the reactor should perform routing table lookup to determine the outgoing interface(s) at which the packet is sent.
Explicit Multicasting
The initiator sends a message consisting of:
  1. an integer (int) of value that indicates which sending service should be applied to this sending,
  2. the packet (InetPacket) to be sent,
  3. the indices of the interfaces (int[]).
Upon receipt of such a request, the reactor sends the packet at the specified interfaces.
ExclusiveBroadcasting
The initiator sends a message that has exactly the same format as a explicit-multicasting request. Upon receipt of such a request, the reactor sends the packet at all interfaces except the ones specified.
This class also provides a set of static methods (getForwardPack(...), getMcastPack()s and getBcastPack(...)s), at least one for each sending service, to faciliate constructing the sending packages at the initiator. These methods are useful in implementing the protocols that are right above the core service layer.

See Also:
CoreServiceLayer

Nested Class Summary
static class PktSending.Message
           
 
Field Summary
static int BROADCAST
           
static PktSending INSTANCE
           
static int MULTICAST
           
 
Fields inherited from class drcl.comp.Contract
Role_INITIATOR, Role_PEER, Role_REACTOR
 
Constructor Summary
PktSending()
           
PktSending(int role_)
           
 
Method Summary
static PktSending.Message getBcastPack(java.lang.Object pkt_, int pktsize_, long src_, long dest_, boolean routerAlert_, int ttl_, long tos_, int excludedIf_)
          Creates and returns an exclusive-broadcasting request.
static PktSending.Message getBcastPack(java.lang.Object pkt_, int pktsize_, long src_, long dest_, boolean routerAlert_, int ttl_, long tos_, int[] excludedIfs_)
          Creates and returns an exclusive-broadcasting request.
static PktSending.Message getBcastPack(Packet pkt_, long src_, long dest_, boolean routerAlert_, int ttl_, long tos_, int excludedIf_)
          Creates and returns an exclusive-broadcasting request.
static PktSending.Message getBcastPack(Packet pkt_, long src_, long dest_, boolean routerAlert_, int ttl_, long tos_, int[] excludedIfs_)
          Creates and returns an exclusive-broadcasting request.
 java.lang.Object getContractContent()
          Returns the content of this contract (format?).
static InetPacket getForwardPack(java.lang.Object pkt_, int pktsize_, long src_, long dest_, boolean routerAlert_, int ttl_, long tos_)
          Creates and returns a default-forwarding request.
static InetPacket getForwardPack(Packet pkt_, long src_, long dest_, boolean routerAlert_, int ttl_, long tos_)
          Creates and returns a default-forwarding request.
static PktSending.Message getMcastPack(java.lang.Object pkt_, int pktsize_, long src_, long dest_, boolean routerAlert_, int ttl_, long tos_, int[] ifs_)
          Creates and returns an explicit-multicasting request.
static PktSending.Message getMcastPack(Packet pkt_, long src_, long dest_, boolean routerAlert_, int ttl_, long tos_, int[] ifs_)
          Creates and returns an explicit-multicasting request.
 java.lang.String getName()
           
 
Methods inherited from class drcl.comp.Contract
getRole, match, setRole
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final PktSending INSTANCE

MULTICAST

public static final int MULTICAST
See Also:
Constant Field Values

BROADCAST

public static final int BROADCAST
See Also:
Constant Field Values
Constructor Detail

PktSending

public PktSending()

PktSending

public PktSending(int role_)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class Contract

getContractContent

public java.lang.Object getContractContent()
Description copied from class: Contract
Returns the content of this contract (format?).

Specified by:
getContractContent in class Contract

getForwardPack

public static InetPacket getForwardPack(Packet pkt_,
                                        long src_,
                                        long dest_,
                                        boolean routerAlert_,
                                        int ttl_,
                                        long tos_)
Creates and returns a default-forwarding request.

Parameters:
pkt_ - the packet.
src_ - source.
dest_ - destination.
routerAlert_ - "router alert" flag.
ttl_ - "time-to-live".
tos_ - type of service.

getForwardPack

public static InetPacket getForwardPack(java.lang.Object pkt_,
                                        int pktsize_,
                                        long src_,
                                        long dest_,
                                        boolean routerAlert_,
                                        int ttl_,
                                        long tos_)
Creates and returns a default-forwarding request.

Parameters:
pkt_ - the packet.
pktsize_ - the packet size.
src_ - source.
dest_ - destination.
routerAlert_ - "router alert" flag.
ttl_ - "time-to-live".
tos_ - type of service.

getMcastPack

public static PktSending.Message getMcastPack(Packet pkt_,
                                              long src_,
                                              long dest_,
                                              boolean routerAlert_,
                                              int ttl_,
                                              long tos_,
                                              int[] ifs_)
Creates and returns an explicit-multicasting request.

Parameters:
pkt_ - the packet.
src_ - source.
dest_ - destination.
routerAlert_ - "router alert" flag.
ttl_ - "time-to-live".
tos_ - type of service.
ifs_ - indices of the interfaces to forward the packet on.

getMcastPack

public static PktSending.Message getMcastPack(java.lang.Object pkt_,
                                              int pktsize_,
                                              long src_,
                                              long dest_,
                                              boolean routerAlert_,
                                              int ttl_,
                                              long tos_,
                                              int[] ifs_)
Creates and returns an explicit-multicasting request.

Parameters:
pkt_ - the packet.
pktsize_ - the packet size.
src_ - source.
dest_ - destination.
routerAlert_ - "router alert" flag.
ttl_ - "time-to-live".
tos_ - type of service.
ifs_ - indices of the interfaces to forward the packet on.

getBcastPack

public static PktSending.Message getBcastPack(Packet pkt_,
                                              long src_,
                                              long dest_,
                                              boolean routerAlert_,
                                              int ttl_,
                                              long tos_,
                                              int excludedIf_)
Creates and returns an exclusive-broadcasting request.

Parameters:
pkt_ - the packet.
src_ - source.
dest_ - destination.
routerAlert_ - "router alert" flag.
ttl_ - "time-to-live".
tos_ - type of service.
excludedIf_ - index of the interface to be excluded from forwarding of the packet.

getBcastPack

public static PktSending.Message getBcastPack(java.lang.Object pkt_,
                                              int pktsize_,
                                              long src_,
                                              long dest_,
                                              boolean routerAlert_,
                                              int ttl_,
                                              long tos_,
                                              int excludedIf_)
Creates and returns an exclusive-broadcasting request.

Parameters:
pkt_ - the packet.
pktsize_ - the packet size.
src_ - source.
dest_ - destination.
routerAlert_ - "router alert" flag.
ttl_ - "time-to-live".
tos_ - type of service.
excludedIf_ - index of the interface to be excluded from forwarding of the packet.

getBcastPack

public static PktSending.Message getBcastPack(Packet pkt_,
                                              long src_,
                                              long dest_,
                                              boolean routerAlert_,
                                              int ttl_,
                                              long tos_,
                                              int[] excludedIfs_)
Creates and returns an exclusive-broadcasting request.

Parameters:
pkt_ - the packet.
src_ - source.
dest_ - destination.
routerAlert_ - "router alert" flag.
ttl_ - "time-to-live".
tos_ - type of service.

getBcastPack

public static PktSending.Message getBcastPack(java.lang.Object pkt_,
                                              int pktsize_,
                                              long src_,
                                              long dest_,
                                              boolean routerAlert_,
                                              int ttl_,
                                              long tos_,
                                              int[] excludedIfs_)
Creates and returns an exclusive-broadcasting request.

Parameters:
pkt_ - the packet.
pktsize_ - the packet size.
src_ - source.
dest_ - destination.
routerAlert_ - "router alert" flag.
ttl_ - "time-to-live".
tos_ - type of service.

J-Sim v1.2.1-p7 API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~