// // CONSTANTS FROM RFC 3927 www.ietf.org/rfc/rfc3927.txt // // The following 10 constant declarations are copied almost verbatim from Section 9 // "The following timing constants are used in this protocol; they are // not intended to be user configurable." const int PROBE_WAIT = 1; // second (initial random delay) const int PROBE_NUM = 3; // (number of probe packets) const int PROBE_MIN = 1; // second (minimum delay till repeated probe) const int PROBE_MAX = 2; // seconds (maximum delay till repeated probe) const int ANNOUNCE_WAIT = 2; // seconds (delay before announcing) const int ANNOUNCE_NUM = 2; // (number of announcement packets) const int ANNOUNCE_INTERVAL = 2; // seconds (time between announcement packets) const int MAX_CONFLICTS = 10; // (max conflicts before rate limiting) const int RATE_LIMIT_INTERVAL = 60; // second (delay between successive attempts) const int DEFEND_INTERVAL = 10; // seconds (minimum interval between defensive ARPs). //The following constants specify the dimensions of the model const int l = 2; // number of hardware addresses (including all zeroes address) const int m = 2; // number of available link local IP addresses //real value is 65024 but simulator can't handle that const int n = 3; // number of network automata typedef scalar[l] HAtype; typedef scalar[m+1] IPtype; //an IP address in our model is either a link local address or the zero address IPtype zero; typedef scalar[n] Networktype; IPtype IP[HAtype]; // array recording (guessed) IP address for each host, zero means no address guessed bool UseIP[HAtype]; // array recording whether host is using an IP address // channels to send messages to network, reset a host, receive messages from network, and to send answers back to network chan send_req,reset[HAtype],receive_msg[Networktype][HAtype],send_answer[Networktype]; // trick to make certain transitions urgent urgent broadcast chan urg; typedef struct{ HAtype senderHA; // sender hardware address IPtype senderIP; // sender IP address IPtype targetIP; // target IP address bool request; // is the packet a Request or a Reply }ARP_packet; meta HAtype ha0; void initialize(ARP_packet& p) { p.senderHA := ha0; p.senderIP := zero; p.targetIP := zero; p.request := false; } //meta because it is used only for value passing in synchronizations meta ARP_packet packet; system Config, InputHandler,Regular,Network;