tags:

views:

479

answers:

2

I am trying to optimize my TCP/IP settings such as TCP Window size, MSS and MTU. I would like to do this with the following steps:

  1. Adjust settings.
  2. Force reload of TCP settings
  3. Run tests and save throughputs and latencies.
  4. Rinse, Lather, Repeat.

My problem is that I don't know how to do step 2. Everything I've read says a reboot is required, but there MUST be a way to force it, no?

+1  A: 
razzed
I should clarify that I am doing this within an application, ie these are not manual steps. However, I can do the equivalent of the repair with dos commands. The question is whether this actually reloads these settings. Which allows me to pose the question slightly differently. How can I get the current active TCP/IP settings - TCP Window, MTU, MSS, etc?
patrick
Updated to answer your question... again.
razzed
+1  A: 

Here are some VBScript examples to extract the data you requested (including MTU, Window Size and a whole lot more):

All general adapter info:

On Error Resume Next
Dim strComputer
Dim objWMIService
Dim propValue
Dim objItem
Dim SWBemlocator
Dim UserName
Dim Password
Dim colItems

strComputer = "."
UserName = ""
Password = ""
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter",,48)
For Each objItem in colItems
    WScript.Echo "AdapterType: " & objItem.AdapterType
    WScript.Echo "AdapterTypeId: " & objItem.AdapterTypeId
    WScript.Echo "AutoSense: " & objItem.AutoSense
    WScript.Echo "Availability: " & objItem.Availability
    WScript.Echo "Caption: " & objItem.Caption
    WScript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
    WScript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
    WScript.Echo "CreationClassName: " & objItem.CreationClassName
    WScript.Echo "Description: " & objItem.Description
    WScript.Echo "DeviceID: " & objItem.DeviceID
    WScript.Echo "ErrorCleared: " & objItem.ErrorCleared
    WScript.Echo "ErrorDescription: " & objItem.ErrorDescription
    WScript.Echo "GUID: " & objItem.GUID
    WScript.Echo "Index: " & objItem.Index
    WScript.Echo "InstallDate: " & objItem.InstallDate
    WScript.Echo "Installed: " & objItem.Installed
    WScript.Echo "InterfaceIndex: " & objItem.InterfaceIndex
    WScript.Echo "LastErrorCode: " & objItem.LastErrorCode
    WScript.Echo "MACAddress: " & objItem.MACAddress
    WScript.Echo "Manufacturer: " & objItem.Manufacturer
    WScript.Echo "MaxNumberControlled: " & objItem.MaxNumberControlled
    WScript.Echo "MaxSpeed: " & objItem.MaxSpeed
    WScript.Echo "Name: " & objItem.Name
    WScript.Echo "NetConnectionID: " & objItem.NetConnectionID
    WScript.Echo "NetConnectionStatus: " & objItem.NetConnectionStatus
    WScript.Echo "NetEnabled: " & objItem.NetEnabled
    for each propValue in objItem.NetworkAddresses
     WScript.Echo "NetworkAddresses: " & propValue
    next
    WScript.Echo "PermanentAddress: " & objItem.PermanentAddress
    WScript.Echo "PhysicalAdapter: " & objItem.PhysicalAdapter
    WScript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
    for each propValue in objItem.PowerManagementCapabilities
     WScript.Echo "PowerManagementCapabilities: " & propValue
    next
    WScript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
    WScript.Echo "ProductName: " & objItem.ProductName
    WScript.Echo "ServiceName: " & objItem.ServiceName
    WScript.Echo "Speed: " & objItem.Speed
    WScript.Echo "Status: " & objItem.Status
    WScript.Echo "StatusInfo: " & objItem.StatusInfo
    WScript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
    WScript.Echo "SystemName: " & objItem.SystemName
    WScript.Echo "TimeOfLastReset: " & objItem.TimeOfLastReset
Next

All specific adapter config:

On Error Resume Next
Dim strComputer
Dim objWMIService
Dim propValue
Dim objItem
Dim SWBemlocator
Dim UserName
Dim Password
Dim colItems

strComputer = "."
UserName = ""
Password = ""
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration",,48)
For Each objItem in colItems
    WScript.Echo "ArpAlwaysSourceRoute: " & objItem.ArpAlwaysSourceRoute
    WScript.Echo "ArpUseEtherSNAP: " & objItem.ArpUseEtherSNAP
    WScript.Echo "Caption: " & objItem.Caption
    WScript.Echo "DatabasePath: " & objItem.DatabasePath
    WScript.Echo "DeadGWDetectEnabled: " & objItem.DeadGWDetectEnabled
    for each propValue in objItem.DefaultIPGateway
     WScript.Echo "DefaultIPGateway: " & propValue
    next
    WScript.Echo "DefaultTOS: " & objItem.DefaultTOS
    WScript.Echo "DefaultTTL: " & objItem.DefaultTTL
    WScript.Echo "Description: " & objItem.Description
    WScript.Echo "DHCPEnabled: " & objItem.DHCPEnabled
    WScript.Echo "DHCPLeaseExpires: " & objItem.DHCPLeaseExpires
    WScript.Echo "DHCPLeaseObtained: " & objItem.DHCPLeaseObtained
    WScript.Echo "DHCPServer: " & objItem.DHCPServer
    WScript.Echo "DNSDomain: " & objItem.DNSDomain
    for each propValue in objItem.DNSDomainSuffixSearchOrder
     WScript.Echo "DNSDomainSuffixSearchOrder: " & propValue
    next
    WScript.Echo "DNSEnabledForWINSResolution: " & objItem.DNSEnabledForWINSResolution
    WScript.Echo "DNSHostName: " & objItem.DNSHostName
    for each propValue in objItem.DNSServerSearchOrder
     WScript.Echo "DNSServerSearchOrder: " & propValue
    next
    WScript.Echo "DomainDNSRegistrationEnabled: " & objItem.DomainDNSRegistrationEnabled
    WScript.Echo "ForwardBufferMemory: " & objItem.ForwardBufferMemory
    WScript.Echo "FullDNSRegistrationEnabled: " & objItem.FullDNSRegistrationEnabled
    for each propValue in objItem.GatewayCostMetric
     WScript.Echo "GatewayCostMetric: " & propValue
    next
    WScript.Echo "IGMPLevel: " & objItem.IGMPLevel
    WScript.Echo "Index: " & objItem.Index
    WScript.Echo "InterfaceIndex: " & objItem.InterfaceIndex
    for each propValue in objItem.IPAddress
     WScript.Echo "IPAddress: " & propValue
    next
    WScript.Echo "IPConnectionMetric: " & objItem.IPConnectionMetric
    WScript.Echo "IPEnabled: " & objItem.IPEnabled
    WScript.Echo "IPFilterSecurityEnabled: " & objItem.IPFilterSecurityEnabled
    WScript.Echo "IPPortSecurityEnabled: " & objItem.IPPortSecurityEnabled
    for each propValue in objItem.IPSecPermitIPProtocols
     WScript.Echo "IPSecPermitIPProtocols: " & propValue
    next
    for each propValue in objItem.IPSecPermitTCPPorts
     WScript.Echo "IPSecPermitTCPPorts: " & propValue
    next
    for each propValue in objItem.IPSecPermitUDPPorts
     WScript.Echo "IPSecPermitUDPPorts: " & propValue
    next
    for each propValue in objItem.IPSubnet
     WScript.Echo "IPSubnet: " & propValue
    next
    WScript.Echo "IPUseZeroBroadcast: " & objItem.IPUseZeroBroadcast
    WScript.Echo "IPXAddress: " & objItem.IPXAddress
    WScript.Echo "IPXEnabled: " & objItem.IPXEnabled
    for each propValue in objItem.IPXFrameType
     WScript.Echo "IPXFrameType: " & propValue
    next
    WScript.Echo "IPXMediaType: " & objItem.IPXMediaType
    for each propValue in objItem.IPXNetworkNumber
     WScript.Echo "IPXNetworkNumber: " & propValue
    next
    WScript.Echo "IPXVirtualNetNumber: " & objItem.IPXVirtualNetNumber
    WScript.Echo "KeepAliveInterval: " & objItem.KeepAliveInterval
    WScript.Echo "KeepAliveTime: " & objItem.KeepAliveTime
    WScript.Echo "MACAddress: " & objItem.MACAddress
    WScript.Echo "MTU: " & objItem.MTU
    WScript.Echo "NumForwardPackets: " & objItem.NumForwardPackets
    WScript.Echo "PMTUBHDetectEnabled: " & objItem.PMTUBHDetectEnabled
    WScript.Echo "PMTUDiscoveryEnabled: " & objItem.PMTUDiscoveryEnabled
    WScript.Echo "ServiceName: " & objItem.ServiceName
    WScript.Echo "SettingID: " & objItem.SettingID
    WScript.Echo "TcpipNetbiosOptions: " & objItem.TcpipNetbiosOptions
    WScript.Echo "TcpMaxConnectRetransmissions: " & objItem.TcpMaxConnectRetransmissions
    WScript.Echo "TcpMaxDataRetransmissions: " & objItem.TcpMaxDataRetransmissions
    WScript.Echo "TcpNumConnections: " & objItem.TcpNumConnections
    WScript.Echo "TcpUseRFC1122UrgentPointer: " & objItem.TcpUseRFC1122UrgentPointer
    WScript.Echo "TcpWindowSize: " & objItem.TcpWindowSize
    WScript.Echo "WINSEnableLMHostsLookup: " & objItem.WINSEnableLMHostsLookup
    WScript.Echo "WINSHostLookupFile: " & objItem.WINSHostLookupFile
    WScript.Echo "WINSPrimaryServer: " & objItem.WINSPrimaryServer
    WScript.Echo "WINSScopeID: " & objItem.WINSScopeID
    WScript.Echo "WINSSecondaryServer: " & objItem.WINSSecondaryServer
Next
Izzy