| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjist.swans.net.NetIp
public class NetIp
IPv4 implementation based on RFC 791. Performs protocol multiplexing, and prioritized packet queuing, but no RED or packet fragmentation.
| Nested Class Summary | |
|---|---|
| static class | NetIp.NicInfoInformation about each network interface. | 
| Nested classes/interfaces inherited from interface jist.swans.net.NetInterface | 
|---|
| NetInterface.NetHandler | 
| Field Summary | |
|---|---|
| static boolean | DEBUG | 
| static boolean | DEBUG_MAC_DEADLOCK | 
| static boolean | DEBUG_NI_BUSY | 
| protected  PacketLoss | incomingLosspacket loss models. | 
| protected  NetAddress | localAddrlocal network address. | 
| static org.apache.log4j.Logger | logIP logger. | 
| static byte | MAX_QUEUE_LENGTHMaximum packet queue length. | 
| protected  NetIp.NicInfo[] | nicsnetwork interfaces. | 
| protected  PacketLoss | outgoingLosspacket loss models. | 
| protected  NetInterface.NetHandler[] | protocolHandlersprotocol handlers. | 
| protected  Mapper | protocolMapprotocol number mapping. | 
| protected  RouteInterface | routingrouting protocol. | 
| protected  NetInterface | selfself-referencing proxy entity. | 
| static int | THRESHOLD_FRAGMENTPacket fragmentation threshold. | 
| Constructor Summary | |
|---|---|
| NetIp(NetAddress addr,
      Mapper protocolMap,
      PacketLoss in,
      PacketLoss out)Initialize IP implementation with given address and protocol mapping. | |
| Method Summary | |
|---|---|
|  byte | addInterface(MacInterface macEntity)Add network interface with default queue. | 
|  byte | addInterface(MacInterface macEntity,
             MessageQueue q)Add network interface. | 
|  void | dropNotify(Message msg,
           MacAddress nextHopMac,
           Reason reason)Notification mechanism for packet dropped due to various "Reasons" | 
|  NetAddress | getAddress()Return local network address. | 
|  NetInterface | getProxy()Return self-referencing proxy entity. | 
|  void | pump(int interfaceId)Request next packet to send, if one exists; indicate that interface has completed processing previous request. | 
|  void | receive(Message msg,
        MacAddress lastHop,
        byte macId,
        boolean promisc)Receive a message from the link layer. | 
|  void | send(Message msg,
     NetAddress dst,
     short protocol,
     byte priority,
     byte ttl)Route, if necessary, and send a message (from TRANSPORT). | 
|  void | send(NetMessage.Ip msg,
     int interfaceId,
     MacAddress nextHop)Send a message along given interface (usually from ROUTING). | 
|  void | setAddress(NetAddress addr)Set local network address. | 
|  void | setProtocolHandler(int protocolId,
                   NetInterface.NetHandler handler)Set network protocol handler. | 
|  void | setRouting(RouteInterface routingEntity)Set routing implementation. | 
|  java.lang.String | toString() | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final boolean DEBUG
public static final boolean DEBUG_NI_BUSY
public static final boolean DEBUG_MAC_DEADLOCK
public static final org.apache.log4j.Logger log
public static final int THRESHOLD_FRAGMENT
public static final byte MAX_QUEUE_LENGTH
protected NetInterface self
protected NetAddress localAddr
protected RouteInterface routing
protected Mapper protocolMap
protected NetInterface.NetHandler[] protocolHandlers
protected NetIp.NicInfo[] nics
protected PacketLoss incomingLoss
protected PacketLoss outgoingLoss
| Constructor Detail | 
|---|
public NetIp(NetAddress addr,
             Mapper protocolMap,
             PacketLoss in,
             PacketLoss out)
addr - local network addressprotocolMap - protocol number mappingin - incoming packet loss modelout - outgoing packet loss model| Method Detail | 
|---|
public NetInterface getProxy()
public void setAddress(NetAddress addr)
addr - local network address
public void dropNotify(Message msg,
                       MacAddress nextHopMac,
                       Reason reason)
dropNotify in interface NetInterfacepublic void setRouting(RouteInterface routingEntity)
routingEntity - routing entitypublic byte addInterface(MacInterface macEntity)
macEntity - link layer entity
public byte addInterface(MacInterface macEntity,
                         MessageQueue q)
macEntity - link layer entity
public void setProtocolHandler(int protocolId,
                               NetInterface.NetHandler handler)
protocolId - protocol identifierhandler - protocol handler
public NetAddress getAddress()
                      throws JistAPI.Continuation
getAddress in interface NetInterfaceJistAPI.Continuation - never (blocking event)
public void receive(Message msg,
                    MacAddress lastHop,
                    byte macId,
                    boolean promisc)
receive in interface NetInterfacemsg - incoming network packetlastHop - link-level source of incoming packetmacId - incoming interfacepromisc - whether network interface is in promisc. mode
public void send(Message msg,
                 NetAddress dst,
                 short protocol,
                 byte priority,
                 byte ttl)
send in interface NetInterfacemsg - packet payload (usually from transport or routing layers)dst - packet destination addressprotocol - packet protocol identifierpriority - packet priorityttl - packet time-to-live value
public void send(NetMessage.Ip msg,
                 int interfaceId,
                 MacAddress nextHop)
send in interface NetInterfacemsg - packet (usually from routing layer)interfaceId - interface along which to send packetnextHop - packet next hop addresspublic void pump(int interfaceId)
pump in interface NetInterfaceinterfaceId - interface identifierpublic java.lang.String toString()
toString in class java.lang.Object| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||