100 likes | 193 Views
host. host. host. Router. Timeline 1. Router. Timeline 2. SharedLink (Ethernet, Wireless). InChannel (1 per entity, processes: listen(), process_arrived_msg () ) OutChannel (1 per NicInterface ) Entity (Host, Router, Switch, SharedLink ). host. host. host. host. host. host.
E N D
host host host Router Timeline 1 Router Timeline 2 SharedLink (Ethernet, Wireless) InChannel (1 per entity, processes: listen(), process_arrived_msg() ) OutChannel (1 per NicInterface) Entity (Host, Router, Switch, SharedLink) host host host
host host host Router Timeline 1 Router Timeline 2 SharedLink (CSMA/CD,CA) Each NicInterface has one InChannel and one OutChannel Each Entity (Host, Router, Switch, SharedLink) has one listen() process over all InChannels, and one process_arrived_msg() host host host
Router host APP TCP/UDP IP IP (possibly switch layer too) Switch layer Forwarding table Network_interface • Network_interface • Network_interface • Network_interface • Network_interface • Network_interface Switch MAC MAC MAC MAC MAC MAC PHY PHY PHY PHY PHY PHY NIC_interface can contain wireless, Ethernet, Simple MAC on a single machine Forwardingtable.h class RouteInfo : public TrieData {} {… IPADDR next_hop_ip; MACADDR dst_mac; //next_hop /** The network interface (this host) through which it gets to the next hop. */ Interface* nic; //from link, it can tell the dst interface } class ForwardingTable : protected Trie { … RouteInfo* getRoute(IPADDR ipaddr); //longest prefix match }
Class Host::Entity :: DmlObject ::ProtocolGraph { //from Entity ltime_tnow(); Timeline* alignment(); Handle waitFor(); timeConversiondoubletick vector<OutChannel*> __outchannel_list; // list of outchannels owned by this entity vector<InChannel*> __inchannel_list; // list of inchannels owned by this entity vector<Process*> __process_list; // list of processes owned by this entity map<string,Process*> ProcessName; map<string,InChannel*> InChannelName; listen(); //listen on all inChannels(binding) process_arrived_msg(); //deliver to the right NicInterface Nhinhi_host; vector<NetworkInterface*>; void config(dml::Configuration *cfg); void init(); rnggetRandom(); boolis_router; boolis_switch; //may change to dml keyword router/switch instead of host later loadForwardingTable(); }
Class NetworkInterface() ::DmlObject ::ProtocolGraph { Nhi, nhi_nic; IPAddrip; MACAddr mac; OutChannel* oc; InChannel* ic; boolis_oc_connected; //default false, change when mapping to other ic boolis_ic_connected; //default false, change when other oc maps to it sendPacket(); //writeTo OC, the message (activation) may refer to SenderInfo() in milieu.h void attach_to_link (Link *link); //set attached_link when creating connection in Link Link * attached_link; //LinkInfo* link_info MACProtocolSession * mac_sess; PHYProtocolSession *phy_sess; //statistics like [later] intinPackets intoutPackets TCPDump* tcpdump }
Class Link :: DmlObject // store info of nw_inf and their connections, delay (what delay?), may store fluid info for (dos attack) { InChannel* in; OutNicInterfacesChannel** out; void connect(); //map IC and OC void config(dml::Configuration *cfg); void init(); void diplay() } Class SharedLink::Link::Entity //todo, for wireless or CSMA/CD Ethernet { Nhinhi; Timeline* timeline; listen(); //listen on all inChannels (binding) process_arrived_msg(); //deliver to the right NicInterface }
Class Net { Nhinhi; InChannel* in; OutNicInterfacesChannel** out; Timeline* timeline; }
//one per timeline (different from ssfnet), central place to store per-timeline info // ideal place for some func and data in community and milieu Class AlignmentServices { }
Class IPSession { } Forwardingtable.h class RouteInfo : public TrieData{} { … /** The IP address of the next hop. */ IPADDR next_hop; /** The network interface through which it gets to the next hop. */ Interface* nic; //from link, it can tell the dst interface //add MACADDR for each nic interface } class ForwardingTable : protected Trie{ RouteInfo* getRoute(IPADDR ipaddr); //longest prefix match } xx-rt.dml forwarding_table [ node_nhi 0:0 nhi_route [ dest :0:1(0) interface 1 next_hop :0:1(0) ] nhi_route [ dest :0:2(0) interface 2 next_hop :0:2(0) ] nhi_route [ dest :1:0(0) interface 0 next_hop :1:0(0) ] nhi_route [ dest :1:0(1) interface 0 next_hop :1:0(0) ] nhi_route [ dest :1:0(2) interface 0 next_hop :1:0(0) ] nhi_route [ dest :1:1(0) interface 0 next_hop :1:0(0) ] nhi_route [ dest :1:2(0) interface 0 next_hop :1:0(0) ] ] forwarding_table [ node_nhi 0:1 nhi_route [ dest default interface 0 ] ]
//global storage for all naming info Class NameSrv { }