Commit 6410d3a5 authored by Pramod R Sanaga's avatar Pramod R Sanaga

Changes to Dummynet in FBSD-410 and its corresponding delay-agent. These modifications

add the BACKFILL parameter to the default delay node kernel. The new Image ID is FBSD410-DEL-DNETMOD.
parent dd6fec7a
Modifications to Dummynet & delay-agent to add Backfill:
The files in the current directory (ip_dummynet.c/.h & dummynet_callback.c) are for
the delay node with FBSD-5.4 ( FBSD54-DNODE-PUBSUB image ).
Compilation instrctions:
a) Kernel:
1) Start with the FreeBSD source of the FBSD54-DNODE-PUBSUB image. Copy the ip_dummynet.h file
to /usr/include/netinet/ip_dummynet.h.
2) Copy ip_dummynet.h and ip_dummynet.c to kernel_src/sys/netinet/
3) Compile the kernel.
4) The delay node Image ID with these modifications is FBSD54-DNODE-DNETMOD.
b) Delay agent:
After step(1) above, overwrite the callback.c in the delay-agent cvs source with the file
dummynet_callback.c & run make.
Steps to build a FBSD-4.10 Delay kernel with Backfill:
The required files are in the fbsd410/kernel & fbsd410/delay-agent directories. For the kernel
follow the same steps as above(starting with the source of FBSD410-STD).
For the delay agent, overwrite the cvs files main.h & callback.c
of the cvs source with the modified versions and run make.
The delay node Image ID with these modifications is FBSD410-DEL-DNETMOD.
Pramod ( )
* Copyright (c) 2000-2003 University of Utah and the Flux Group.
* All rights reserved.
* agent-main.h --
* Delay node agent data structures
#ifndef __AGENT_MAIN_H
#define __AGENT_MAIN_H
/* for setsockopt and stuff */
#include <sys/param.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <paths.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <grp.h>
#include <limits.h>
#include <netdb.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <sysexits.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/ip_fw.h>
#include <net/route.h> /* def. of struct route */
#include <netinet/ip_dummynet.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
/* for setsockopt and stuff */
#include <stdio.h>
#include <unistd.h>
#include "event.h"
#include "tbdefs.h"
#include "log.h"
#if 0
#include "tbdb.h"
#if 0
/* these are defined in testbed/lib/libtb/tbdb.h, will include
that directory later and then throw out these defines
#define MAX_LINE_LENGTH 512
#define MAX_LINKS 256 /* Virtual interfaces */
/*************************USER DEFINED TYPES********************************/
/* flag bits which indicate pipe parameters*/
#define PIPE_QSIZE_IN_BYTES 0x0001
#define PIPE_Q_IS_RED 0x0002
#define PIPE_Q_IS_GRED 0x0004
#define PIPE_HAS_FLOW_MASK 0x0008
/* Parameters for RED and gentle RED*/
typedef struct {
/* from ip_dummynet.h*/
double w_q ; /* queue weight */
int max_th ; /* maximum threshold for queue (scaled) */
int min_th ; /* minimum threshold for queue (scaled) */
double max_p ; /* maximum value for p_b */
} structRed_params;
/* link status*/
typedef enum {
LINK_UP = 0,
/* Pipe parameter structures*/
typedef struct {
int delay; /* pipe delay*/
int bw; /* pipe bw*/
int backfill; /*pramod-CHANGES, -add backfill to the pipe*/
double plr; /* queue loss rate*/
int q_size; /* queuq size in slots/bytes*/
structRed_params red_gred_params; /* red/gred params*/
struct ipfw_flow_id id ; /* flow mask of the pipe*/
int buckets; /* number of buckets*/
int n_qs; /* number of dynamic queues */
u_short flags_p;
}structpipe_params, *structpipe_params_t;
/* This structure maps the linkname (eg. link0 ) to the physical
interfaces(eg. fxp0) and to the pipe numbers created at the start of
the experiment.
Later as events are recd. this table tells which pipe configuration should
be modified
typedef struct {
char *linkname; /*link0, link1 etc*/
int islan; /* 1 if a lan, 0 if a duplex link */
int numpipes; /* 1 if a simplex pipe, 2 if a duplex pipe */
char *interfaces[2];/* fxp0, fxp1 etc*/
char *vnodes[2]; /* nodeA, nodeB*/
char linkvnodes[2][256]; /* link0-nodeA, link0-nodeB*/
char *linktype; /*simplex, duplex */
int pipes[2]; /* array of pipe numbers*/
structpipe_params params[2]; /* params for the two pipes*/
enumlinkstat stat; /* link status : UP/DOWN*/
}structlink_map, * structlink_map_t;
/*************************USER DEFINED TYPES********************************/
/******************************Function prototypes******************************/
void usage(char *);
void fill_tuple(address_tuple_t);
void agent_callback(event_handle_t handle,
event_notification_t notification, void *data);
void handle_pipes (char *objname, char *eventtype, event_notification_t
,event_handle_t, int);
int checkevent (char *);
void handle_link_up(char * linkname, int l_index);
void handle_link_down(char * linkname, int l_index);
void handle_link_modify(char * linkname, int l_index,
event_handle_t handle,
event_notification_t notification);
int get_link_params(int l_index);
void get_flowset_params(struct dn_flow_set*, int, int);
void get_queue_params(struct dn_flow_set*,int, int);
void set_link_params(int l_index, int blackhole, int);
int get_new_link_params(int l_index, event_handle_t handle,
event_notification_t notification,
int *);
void dump_link_map();
int get_link_info();
/******************************Function prototypes******************************/
#endif /*__AGENT_MAIN_H*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment