Networking

Classless Inter-Domain Routing (CIDR)

A Better Solution: Eliminate Address Classes
It was clear that as long as there were only three sizes of networks, the allocation efficiency problem could never be properly rectified. The solution was to get rid of the classes completely, in favor of a classless allocation scheme. This system would solve both of the main problems with “classful� addressing: inefficient address space use, and the exponential growth of routing tables.

The idea behind CIDR is to adapt the concept of subnetting a single network to the entire internet. In essence, then, classless addressing means that instead of breaking a particular network into subnets, we can aggregate networks into larger “supernets�. CIDR is sometimes called supernetting for this reason: it applies the principles of subnetting to larger networks. It is this aggregation of networks into supernets that allowed CIDR to resolve the problem of growing Internet routing tables.

Of course, if we are going to apply subnetting concepts to the entire internet, we need to be able to have subnets of different sizes. After all, that’s one of our primary goals in eliminating the classes. So, more accurately, CIDR is an internet-wide application of not regular one-level subnetting, but of Variable Length Subnet Masking (VLSM). Just as VLSM lets us split a network as many times as we want to create subnets, “sub-subnetsâ€? and “sub-sub-subnetsâ€?, CIDR lets us do this with the entire Internet, as many times as needed.

mais info

Notação standard

A notação standard para o intervalo de endereços CIDR começa com o endereço de rede (na direita com o número apropriado de bits com valor zero – até 4 octetos para IPv4, e até campos hexadecimais de 8 octetos de 16 bits para IPv6). Isto é seguido por um carácter e comprimento de um prefixo, em bits, definindo o tamanho da rede em questão (o prefixo é, na verdade, o comprimento da máscara de subrede).
Por exemplo:

  • 192.168.0.0 /24 representa os 256    endereços IPv4    de 192.168.0.0 até 192.168.0.255 inclusive, com 192.168.0.255 sendo o    endereço de broadcast para a rede.
  • 192.168.0.0 /22 representa os 1024    endereços IPv4    de 192.168.0.0 até 192.168.3.255 inclusive, com 192.168.3.255 sendo o    endereço de broadcast para a rede.
  • 2002:C0A8::/48 representa os endereços    IPv6 de    2002:C0A8:0:0:0:0:0:0 até 2002:C0A8:0:FFFF:FFFF:FFFF:FFFF:FFFF, inclusive.

Para o IPv4, uma representação alternativa usa o endereço de rede seguido da máscara de subrede, escrito na forma decimal com pontos:

  • 192.168.0.0 /24 pode ser escrito    como 192.168.0.0 255.255.255.0
  • 192.168.0.0 /22 pode ser escrito    como 192.168.0.0 255.255.252.0

mais info

Networking

Endereçamento IP

IP Address Class Network and Host Capacities

IP Address Class Total # Of Bits For

Network ID / Host ID

First Octet of IP Address # Of Network ID Bits Used

To Identify Class

Usable # Of Network ID

Bits

Number of Possible Network

IDs

# Of Host IDs Per Network

ID

Class A

8 / 24

0xxx

xxxx

1 8-1 = 7 27-2 = 126

224-2 =

16,277,214

Class

B

16 /

16

10xx

xxxx

2 16-2

= 14

214

= 16,384

216-2 =

65,534

Class

C

24 /

8

110x

xxxx

3 24-3

= 21

221

= 2,097,152

28-2

= 254

  • Se o 1º bit é um “0”, trata-se de um endereço Classe A

  • Se o 2º bit é um “0”, trata-se de um endereço Classe B

  • Se o 3º bit é um “0”, trata-se de um endereço Classe C

  • Se o 4º bit é um “0”, trata-se de um endereço Classe D, (metade do restante, ou um décima sexta do espaço de endereço.) Se for um “1”, é um endereço da classe E. (a outra metade, um décima sexta.)

IP Address Class First Octet of IP Address

Address

Lowest

Value of First Octet (binary)

Highest Value of First

Octet (binary)

Range of First Octet

Values (decimal)

Octets in Network ID /

Host ID

Theoretical IP Address

Range

Class A

0xxx xxxx

0000 0001

0111 1110

1 to

126

1 / 3

1.0.0.0

to 126.255.255.255

Class

B

10xx xxxx

1000 0000

1011 1111

128

to 191

2 / 2

128.0.0.0

to 191.255.255.255

Class

C

110x xxxx

1100 0000

1101 1111

192

to 223

3 / 1

192.0.0.0

to 223.255.255.255

Class

E

1110 xxxx

1110 0000

1110 1111

224

to 239

224.0.0.0 to 239.255.255.255

Class

D

1111 xxxx

1111 0000

1111 1111

240

to 255

240.0.0.0 to 255.255.255.255

IP Address Classes and Class Characteristics and Uses

IP Address Class Fraction of Total IP

Address Space

Number Of Network ID Bits Number Of Host ID Bits Intended Use
Class A 1/2 8 24 Unicast addressing for

very large organizations with hundreds

of thousands or millions of hosts to connect to the Internet.

Class

B

1/4 16 16 Unicast addressing for

medium-to-large organizations with many

hundreds to thousands of hosts to connect to the Internet.

Class

C

1/8 24 8 Unicast addressing for

smaller organizations with no more than

about 250 hosts to connect to the

Internet.

Class

D

1/16 n/a n/a IP multicasting.
Class

E

1/16 n/a n/a Reserved for “experimental use�.

mais info aqui

Networking

OBTENDO O APIPA

(AUTOMATIC PRIVATE IP ADDRESSING – ENDEREÇAMENTO IP PARTICULAR AUTOMÃ?TICO)
A implementação do TCP/IP do Windows XP Professional suporta conceder o endereço IP para configurações de uma rede básica. Esse mecanismo é uma extensão do endereço IP dinâmico concedido para os adaptadores de rede, ativando as configurações do endereço IP sem usar um endereço IP concedido pelo DHCP Server. O APIPA é ativado por padrão no Windows XP Professional para que usuários domésticos ou usuários de pequenas redes possam usar uma única subnet, baseado em uma rede TCP/IP sem ter que configurar o protocolo TCP/IP manualmente ou configurar um DHCP server.
Veja abaixo o processo que o APIPA usa para conceder um endereço IP:

1. Quando o Windows XP Professional é inicializado, ele tenta localizar um DHCP Server sobre a rede para obter um endereço IP dinamicamente.

2. Na ausência de um DHCP Server durante a inicialização do computador, o cliente não poderá obter um endereço IP.

3. O APIPA gera um endereço IP no intervalo 169.254.0.0 até 169.254.255.255, e uma Máscara de Sub-Rede 255.255.0.0.
Agora o cliente consegue alcançar outros clientes que estejam configurados com o APIPA, limitando-se somente a rede 169.254.0.0.

Internet Tips & tricks

Encontrar MP3 através do Google

logo_google_music Procure por:
intitle:index.of “mp3″ +�depeche mode� -htm -html -php -asp “Last Modified�

ASP.Net

Handling Errors

Quando ocorre um erro numa pagina. o ASP.NET envia informação sobre o erro para o cliente. Os erros são divididos em 4 categorias:

  • Configuration errors: Occur when the syntax or structure of a Web.config file in the configuration hierarchy is incorrect.
  • Parser errors: Occur when the ASP.NET syntax on a page is malformed.
  • Compilation errors: Occur when statements in a page’s target language are incorrrect.
  • Run-time errors: Occur during a page’s execution, even though the errors could not be detected at compile time.

By default, the information shown for a run-time error is the call stack (the chains of procedure calls leading up to the exception). If debug mode is enabled, ASP.NET displays the line number in source code where the run-time error originated. Debug mode is a valuable tool for debugging your application. You can enable debug mode at the page level, using the following directive:

>

Note: Running debug mode incurs a heavy performance penalty. Be sure to disable it before deploying your finished application.
Depending on the circumstances, you might want to handle application errors in different ways. For example, at development time you probably want to see the detailed error pages that ASP.NET provides to help you identify and fix problems. However, once an application is being served in a production environment, you probably do not want to display detailed errors to your customer clients. You can use ASP.NET to specify whether errors are shown to local clients, to remote clients, or to both. By default, errors are shown only to local clients (those clients on the same computer as the server). You can also specify a custom error page to redirect clients to if an error occurs.

---------
artigo completo aqui

											
ASP.Net

O arquivo machine.config

Por padrão, todos os directório são herdados de um arquivo de configuração padrão de sistema chamado de machine.config, (localizado em: “WinNT\Microsoft.NET\Framework\Versão\CONFIG“).

ASP.Net

O arquivo Global.asax

O arquivo Global.asax opera de maneira semelhante as páginas *.aspx. Você utiliza o Global.asax para sincronizar qualquer evento exposto pela classe HttpApplication. Eventos quais veremos abaixo:

Evento Descrição
AcquireRequestState Accionado quando o Aplicativo obtém o cache para a solicitação.
AuthenticateRequest Accionado quando o Aplicativo tenta autenticar a solicitação de HTTP.
AuthorizeRequest Accionado quando o Aplicativo tenta autorizar a solicitação de HTTP.
BeginRequest Accionado quando a solicitação de HTTP é iniciada.
EndRequest Acionado quando a solicitação de HTTP é concluída.
Error Acionado quando surge um erro.
PostRequestHandlerExecute Accionado imediatamente depois do handler de HTTP processar a solicitação.
PreRequestHandlerExecute Accionado imediatamente antes do handler de HTTP processar a solicitação.
PreSenderRequestContent Se a solicitação tiver conteúdo adicional (QueryString, Variáveis de Formulário, etc.), esse evento é acionado imediatamente antes daquele conteúdo ser recebido.
PreSenderRequestHeaders Accionado imediatamente antes de os cabeçalhos de solicitação serem recebidos.
ReleaseRequestState Accionado quando o Aplicativo libera o estado de sessão para a solicitação.
ResolveRequestCache Acionado quando o Aplicativo determina o cache para a solicitação.
UpdateRequestCache Accionado quando o Aplicativo autaliza e libera o cache para a solicitação.

——————————-
——————————-

Imports System.Web

Imports System.Web.SessionState
Public Class Global

Inherits System.Web.HttpApplication
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

‘…

End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)

‘…

End Sub
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)

‘…

End Sub
Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)

‘…

End Sub
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

‘…

End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)

‘…

End Sub
Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)

‘…

End Sub

End Class

——————————-

Código 1 – O arquivo Global.asax.

ASP.Net

ASP.NET supports two methods to author pages:

  • In-line code is code that is embedded directly within the ASP.NET page.
  • Code-behind refers to code for your ASP.NET page that is contained within a separate class file. This allows a clean separation of your HTML from your presentation logic.

When we use Microsoft Visual Studio .NET to create ASP.NET Web Forms, code-behind pages are the default method. In addition, Visual Studio .NET automatically performs precompilation for us when we build our solution.

A little bit of background
Directives in ASP.NET control the settings and properties of page and user control compilers. They can be included anywhere on a page, although it is standard to place them at the beginning. Directives are used in both .aspx files (ASP.NET pages) and .ascx files (user control pages). ASP.NET pages actually support eight different directives.
* @ Page

* @ Control

* @ Import

* @ Implements

* @ Register

* @ Assembly

* @ OutputCache

* @ Reference
Page directives are the most commonly used directives, and are used to edit a wide variety of settings that control how the page parser and page compiler work. The following is a list of some of the more commonly used page directive attributes in ASP.NET.
@ Page language=”c#” Codebehind=”WebForm1.aspx.cs”

AutoEventWireup=”false” Inherits=”TestWebApp.WebForm1″

  • Language indicates the language in which the inline script code within the ASP.NET page is written (the code between tags). The value of this attribute can be C#, VB, or JS.
  • Codebehind indicates the name of the file being used as the code supporting this ASP.NET page. This file should reflect the Language setting; that is, if the language being used is C#, the CodeBehind file should have a .cs extension and be written in C#.
  • Inherits indicates a qualified class from which this ASP.NET page should inherit. Generally, this will be the name of the class described in the code-behind file.
  • AutoEventWireup is a Boolean attribute that indicates whether the ASP.NET pages events are auto-wired.

Note: In the above case, ASP.NET compiles the code-behind page on the fly. We have to note that this compilation step only occurs when the code-behind file is updated. Whether the file has been updated or not, well this is detected through a timestamp change.

To get to the Real Thing
The AutoEventWireup attribute may have a value of true or false. When an ASP.NET Web Application is created by using Microsoft Visual Studio .NET, the value of the AutoEventWireup attribute is set as false.
We can specify the default value of the AutoEventWireup attribute in the following locations:

  • The Machine.config file.
  • The Web.config file.
  • Individual Web Forms (.aspx files).
  • Web User Controls (.ascx files)

The value of the AutoEventWireup attribute can be declared in the

section in the Machine.config file or the Web.config file.

Networking

Terminal Services Keyboard Shortcuts

Keyboard Shortcut Function
Alt+Del Displays the active application’s Control menu.
Alt+Home Opens the Windows Start menu within the client session.
Alt+Page Down Cycles (from right to left) through the current taskbar programs.
Alt+Page Up Cycles (from left to right) through the current taskbar programs.
Ctrl+Alt+Break Toggles the client session between windowed and full-screen modes.
Ctrl+Alt+End Opens the Windows Security dialog box, similar to pressing Ctrl+Alt+Del on the local workstation’s keyboard.
Ctrl+Alt+Ins Cycles through the current taskbar programs in the order in which the user started them.
Ctrl+Alt+Plus (+) Copies a snapshot of the entire client-session desktop area to the clipboard, similar to pressing Print Screen on the local workstation’s keyboard.
Ctrl+Alt+Minus (-) Copies a snapshot of the active client window to the clipboard, similar to pressing Alt+Print Screen on the local workstation’s keyboard.
Networking

Mostrar aba da partilha em WinXP com Sp2 numa conta de Domain User

Partilha01Para ficar visivel as abas de partilha e segurança de ficheiros e pastas em Windows XP com SP2, deve ser criada por um administrador do dominio uma conta local de administrador com o mesmo nome da conta do dominio pretendida.